Skip to content

Commit

Permalink
do not actually compute the nested p2wsh-p2sh script if just estimati…
Browse files Browse the repository at this point in the history
…ng size (spesmilo#4412)
  • Loading branch information
devrandom authored and SomberNight committed Jun 7, 2018
1 parent 610b378 commit c6fce4b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,10 @@ def input_script(self, txin, estimate_size=False):
scriptSig = bitcoin.p2wpkh_nested_script(pubkey)
return push_script(scriptSig)
elif _type == 'p2wsh-p2sh':
witness_script = self.get_preimage_script(txin)
if estimate_size:
witness_script = ''
else:
witness_script = self.get_preimage_script(txin)
scriptSig = bitcoin.p2wsh_nested_script(witness_script)
return push_script(scriptSig)
elif _type == 'address':
Expand Down

0 comments on commit c6fce4b

Please sign in to comment.