Skip to content

Commit

Permalink
op_checkmultisig should leave 1 on stack when succesfull
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryp Toon committed May 29, 2024
1 parent 4fffc73 commit 3c4bd3b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions bitcoinlib/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,8 +732,13 @@ def evaluate(self, message=None, env_data=None, trace=False):
method = getattr(self.stack, method_name)
if method_name == 'op_checksig' or method_name == 'op_checksigverify':
res = method(self.message)
elif method_name == 'op_checkmultisig' or method_name == 'op_checkmultisigverify':
elif method_name == 'op_checkmultisig':
method(self.message, self.env_data)
res = self.stack.op_verify()
self.stack.append(self.env_data['redeemscript'])
elif method_name == 'op_checkmultisigverify':
res = method(self.message, self.env_data)
self.stack.append(self.env_data['redeemscript'])
elif method_name == 'op_checklocktimeverify':
res = self.stack.op_checklocktimeverify(
self.env_data['sequence'], self.env_data.get('locktime'))
Expand Down Expand Up @@ -1179,10 +1184,7 @@ def op_checkmultisig(self, message, data=None):
break

if sigcount == len(signatures):
if data and 'redeemscript' in data:
self.append(data['redeemscript'])
else:
self.append(b'\1')
self.append(b'\1')
else:
self.append(b'')
return True
Expand Down

0 comments on commit 3c4bd3b

Please sign in to comment.