diff --git a/torba/basetransaction.py b/torba/basetransaction.py index 0a4609d73..a5fa2fce1 100644 --- a/torba/basetransaction.py +++ b/torba/basetransaction.py @@ -150,7 +150,7 @@ class BaseInput(InputOutput): @classmethod def deserialize_from(cls, stream): - tx_ref = TXRefImmutable.from_hash(stream.read(32)) + tx_ref = TXRefImmutable.from_hash(stream.read(32), -1) position = stream.read_uint32() script = stream.read_string() sequence = stream.read_uint32() diff --git a/torba/hash.py b/torba/hash.py index bd641b03f..049cde243 100644 --- a/torba/hash.py +++ b/torba/hash.py @@ -49,7 +49,11 @@ class TXRef: class TXRefImmutable(TXRef): - __slots__ = '_height', + __slots__ = ('_height',) + + def __init__(self): + super().__init__() + self._height = -1 @classmethod def from_hash(cls, tx_hash: bytes, height: int) -> 'TXRefImmutable':