Correct handling for multi-sig zero signatures.

It is possible for a multisignature transaction to require zero
signatures.  For example, input 2 of testnet transaction
b2d93dfd0b2c1a380e55e76a8d9cb3075dec9f4474e9485be008c337fd62c1f7
in block number 185117.

Previously the code was pushing a false to the stack when no
valid signatures were found.  This commit remedies that by pushing true
when no valid signatures were found, but none are required.  Otherwise it
still pushes false when no valid signatures were found, but some are
required.

Fixes #7.

ok @owainga
This commit is contained in:
Dave Collins 2014-02-19 14:29:43 -06:00
parent fcd73f75ea
commit 1d360509f4

View File

@ -1831,7 +1831,7 @@ func opcodeCheckMultiSig(op *parsedOpcode, s *Script) error {
} }
if len(signatures) == 0 { if len(signatures) == 0 {
s.dstack.PushBool(false) s.dstack.PushBool(nsig == 0)
return nil return nil
} }