commit 6bd66279b0e808d2f823bec8261d90dd71165d65
parent 57013ca9857e4f00f5b11e094e0450c9e6591607
Author: ThomasV <thomasv@electrum.org>
Date: Thu, 3 Aug 2017 07:22:49 +0200
fix segwit script size
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/transaction.py b/lib/transaction.py
@@ -720,7 +720,8 @@ class Transaction:
hashSequence = Hash(''.join(int_to_hex(txin.get('sequence', 0xffffffff - 1), 4) for txin in inputs).decode('hex')).encode('hex')
hashOutputs = Hash(''.join(self.serialize_output(o) for o in outputs).decode('hex')).encode('hex')
outpoint = self.serialize_outpoint(txin)
- scriptCode = push_script(self.get_preimage_script(txin))
+ preimage_script = self.get_preimage_script(txin)
+ scriptCode = var_int(len(preimage_script)/2) + preimage_script
amount = int_to_hex(txin['value'], 8)
nSequence = int_to_hex(txin.get('sequence', 0xffffffff - 1), 4)
preimage = nVersion + hashPrevouts + hashSequence + outpoint + scriptCode + amount + nSequence + hashOutputs + nLocktime + nHashType