Skip to content

Commit

Permalink
Fix error when parsing incorrect spending script witness
Browse files Browse the repository at this point in the history
  • Loading branch information
mccwdev committed Jan 15, 2024
1 parent 245d76f commit 1454d57
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bitcoinlib/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,9 @@ def parse_bytesio(cls, rawtx, strict=True, network=DEFAULT_NETWORK):
inputs[n].script = script if not inputs[n].script else inputs[n].script + script
inputs[n].keys = script.keys
inputs[n].signatures = script.signatures
if script.script_types[0][:13] == 'p2sh_multisig' or script.script_types[0] =='signature_multisig':
if not script.signatures:
inputs[n].script_type = 'unknown'
elif script.script_types[0][:13] == 'p2sh_multisig' or script.script_types[0] =='signature_multisig':
inputs[n].script_type = 'p2sh_multisig'
inputs[n].redeemscript = inputs[n].witnesses[-1]
elif script.script_types[0] == 'p2tr_unlock':
Expand Down

0 comments on commit 1454d57

Please sign in to comment.