From 1d360509f45df050a4acec531a4b2dfe2158fb2d Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Wed, 19 Feb 2014 14:29:43 -0600 Subject: [PATCH] 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 --- opcode.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opcode.go b/opcode.go index bee36f85..710cd212 100644 --- a/opcode.go +++ b/opcode.go @@ -1831,7 +1831,7 @@ func opcodeCheckMultiSig(op *parsedOpcode, s *Script) error { } if len(signatures) == 0 { - s.dstack.PushBool(false) + s.dstack.PushBool(nsig == 0) return nil }