Browse Source

fix segwit script size

2.9.x
ThomasV 8 years ago
parent
commit
6bd66279b0
  1. 3
      lib/transaction.py

3
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

Loading…
Cancel
Save