commit 461cbd357a71659ccacdcc5140a321f8a67c645b
parent ede1fbdb1f0ceeace6adcc139396101d3fed9d8a
Author: ThomasV <thomasv@electrum.org>
Date: Wed, 18 May 2016 11:58:27 +0200
support locktime
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/transaction.py b/lib/transaction.py
@@ -489,6 +489,7 @@ class Transaction:
raise BaseException("cannot initialize transaction", raw)
self._inputs = None
self._outputs = None
+ self.locktime = 0
def update(self, raw):
self.raw = raw
@@ -693,7 +694,7 @@ class Transaction:
script = self.pay_script(output_type, addr)
s += var_int(len(script)/2) # script length
s += script # script
- s += int_to_hex(0, 4) # lock time
+ s += int_to_hex(self.locktime, 4) # locktime
if for_sig is not None and for_sig != -1:
s += int_to_hex(1, 4) # hash type
return s
@@ -833,7 +834,8 @@ class Transaction:
self.deserialize()
out = {
'hex': self.raw,
- 'complete': self.is_complete()
+ 'complete': self.is_complete(),
+ 'final': self.is_final(),
}
return out