Change OP_CHECK_MULTISIG -> OP_CHECKMULTISIG.

This change was made to match the reference implementation.
This commit is contained in:
Dave Collins 2014-01-04 15:13:29 -06:00
parent b713590902
commit 2005fae908
7 changed files with 54 additions and 54 deletions

View file

@ -128,7 +128,7 @@ func scriptToAddrHashTemplate(script []byte, validformats []pkformat) (ScriptTyp
if success == false { if success == false {
if len(script) > 1 { if len(script) > 1 {
// check for a few special case // check for a few special case
if script[len(script)-1] == OP_CHECK_MULTISIG { if script[len(script)-1] == OP_CHECKMULTISIG {
return ScriptStrange, nil, nil return ScriptStrange, nil, nil
} }
if script[0] == OP_0 && (len(script) <= 75 && byte(len(script)) == script[1]+2) { if script[0] == OP_0 && (len(script) <= 75 && byte(len(script)) == script[1]+2) {

View file

@ -146,7 +146,7 @@ var addressTests = []addressTest{
0xa7, 0xa8, 0x45, 0xbd, 0x25, 0x68, 0x9e, 0xdb, 0xa7, 0xa8, 0x45, 0xbd, 0x25, 0x68, 0x9e, 0xdb,
0x72, 0x3d, 0x5a, 0xd4, 0x06, 0x8d, 0xdd, 0x30, 0x72, 0x3d, 0x5a, 0xd4, 0x06, 0x8d, 0xdd, 0x30,
0x36, 0x36,
btcscript.OP_CHECK_MULTISIG, // note this isn't a real tx btcscript.OP_CHECKMULTISIG, // note this isn't a real tx
}, },
addrhash: nil, addrhash: nil,
class: btcscript.ScriptStrange, class: btcscript.ScriptStrange,
@ -305,7 +305,7 @@ var multiSigTests = []multiSigTest{
0x0e, 0x4e, 0xf8, 0x55, 0x19, 0x46, 0xd8, 0xa5, 0x0e, 0x4e, 0xf8, 0x55, 0x19, 0x46, 0xd8, 0xa5,
0x40, 0x91, 0x1a, 0xbe, 0x3e, 0x78, 0x54, 0xa2, 0x40, 0x91, 0x1a, 0xbe, 0x3e, 0x78, 0x54, 0xa2,
0x6f, 0x39, 0xf5, 0x8b, 0x25, 0xc1, 0x53, 0x42, 0x6f, 0x39, 0xf5, 0x8b, 0x25, 0xc1, 0x53, 0x42,
0xaf, btcscript.OP_2, btcscript.OP_CHECK_MULTISIG}, 0xaf, btcscript.OP_2, btcscript.OP_CHECKMULTISIG},
class: btcscript.ScriptMultiSig, class: btcscript.ScriptMultiSig,
reqSigs: 1, reqSigs: 1,
addrhashes: [][]byte{ addrhashes: [][]byte{
@ -342,7 +342,7 @@ var multiSigTests = []multiSigTest{
0x0e, 0x4e, 0xf8, 0x55, 0x19, 0x46, 0xd8, 0xa5, 0x0e, 0x4e, 0xf8, 0x55, 0x19, 0x46, 0xd8, 0xa5,
0x40, 0x91, 0x1a, 0xbe, 0x3e, 0x78, 0x54, 0xa2, 0x40, 0x91, 0x1a, 0xbe, 0x3e, 0x78, 0x54, 0xa2,
0x6f, 0x39, 0xf5, 0x8b, 0x25, 0xc1, 0x53, 0x42, 0x6f, 0x39, 0xf5, 0x8b, 0x25, 0xc1, 0x53, 0x42,
0xaf, btcscript.OP_2, btcscript.OP_CHECK_MULTISIG}, 0xaf, btcscript.OP_2, btcscript.OP_CHECKMULTISIG},
class: btcscript.ScriptMultiSig, class: btcscript.ScriptMultiSig,
reqSigs: 1, reqSigs: 1,
addrhashes: [][]byte{ addrhashes: [][]byte{
@ -388,7 +388,7 @@ var multiSigTests = []multiSigTest{
0x20, 0x36, 0x63, 0x35, 0x33, 0x63, 0x64, 0x39, 0x20, 0x36, 0x63, 0x35, 0x33, 0x63, 0x64, 0x39,
0x38, 0x37, 0x31, 0x31, 0x39, 0x65, 0x66, 0x37, 0x38, 0x37, 0x31, 0x31, 0x39, 0x65, 0x66, 0x37,
0x39, 0x37, 0x64, 0x35, 0x61, 0x64, 0x63, 0x63, 0x39, 0x37, 0x64, 0x35, 0x61, 0x64, 0x63, 0x63,
0x64, btcscript.OP_3, btcscript.OP_CHECK_MULTISIG}, 0x64, btcscript.OP_3, btcscript.OP_CHECKMULTISIG},
class: btcscript.ScriptMultiSig, class: btcscript.ScriptMultiSig,
reqSigs: 1, reqSigs: 1,
addrhashes: [][]byte{ addrhashes: [][]byte{
@ -435,7 +435,7 @@ var multiSigTests = []multiSigTest{
0x32, 0x35, 0x36, 0x33, 0x39, 0x64, 0x33, 0x38, 0x32, 0x35, 0x36, 0x33, 0x39, 0x64, 0x33, 0x38,
0x61, 0x36, 0x63, 0x66, 0x35, 0x30, 0x61, 0x62, 0x61, 0x36, 0x63, 0x66, 0x35, 0x30, 0x61, 0x62,
0x34, 0x63, 0x64, 0x34, 0x34, 0x0a, 0x00, 0x00, 0x34, 0x63, 0x64, 0x34, 0x34, 0x0a, 0x00, 0x00,
0x00, btcscript.OP_3, btcscript.OP_CHECK_MULTISIG}, 0x00, btcscript.OP_3, btcscript.OP_CHECKMULTISIG},
class: btcscript.ScriptMultiSig, class: btcscript.ScriptMultiSig,
reqSigs: 1, reqSigs: 1,
addrhashes: [][]byte{ addrhashes: [][]byte{

View file

@ -3544,17 +3544,17 @@ var popTests = []popTest{
expectedErr: StackErrInvalidOpcode, expectedErr: StackErrInvalidOpcode,
}, },
popTest{ popTest{
name: "OP_CHECK_MULTISIG", name: "OP_CHECKMULTISIG",
pop: &parsedOpcode{ pop: &parsedOpcode{
opcode: opcodemapPreinit[OP_CHECK_MULTISIG], opcode: opcodemapPreinit[OP_CHECKMULTISIG],
data: nil, data: nil,
}, },
expectedErr: nil, expectedErr: nil,
}, },
popTest{ popTest{
name: "OP_CHECK_MULTISIG long", name: "OP_CHECKMULTISIG long",
pop: &parsedOpcode{ pop: &parsedOpcode{
opcode: opcodemapPreinit[OP_CHECK_MULTISIG], opcode: opcodemapPreinit[OP_CHECKMULTISIG],
data: make([]byte, 1), data: make([]byte, 1),
}, },
expectedErr: StackErrInvalidOpcode, expectedErr: StackErrInvalidOpcode,

View file

@ -211,7 +211,7 @@ const (
OP_CODESEPARATOR = 171 OP_CODESEPARATOR = 171
OP_CHECKSIG = 172 OP_CHECKSIG = 172
OP_CHECKSIGVERIFY = 173 OP_CHECKSIGVERIFY = 173
OP_CHECK_MULTISIG = 174 OP_CHECKMULTISIG = 174
OP_CHECKMULTISIGVERIFY = 175 OP_CHECKMULTISIGVERIFY = 175
OP_NOP1 = 176 OP_NOP1 = 176
OP_NOP2 = 177 OP_NOP2 = 177
@ -664,7 +664,7 @@ var opcodemapPreinit = map[byte]*opcode{
opfunc: opcodeCheckSig}, opfunc: opcodeCheckSig},
OP_CHECKSIGVERIFY: {value: OP_CHECKSIGVERIFY, name: "OP_CHECKSIGVERIFY", length: 1, OP_CHECKSIGVERIFY: {value: OP_CHECKSIGVERIFY, name: "OP_CHECKSIGVERIFY", length: 1,
opfunc: opcodeCheckSigVerify}, opfunc: opcodeCheckSigVerify},
OP_CHECK_MULTISIG: {value: OP_CHECK_MULTISIG, name: "OP_CHECK_MULTISIG", length: 1, OP_CHECKMULTISIG: {value: OP_CHECKMULTISIG, name: "OP_CHECKMULTISIG", length: 1,
opfunc: opcodeCheckMultiSig}, opfunc: opcodeCheckMultiSig},
OP_CHECKMULTISIGVERIFY: {value: OP_CHECKMULTISIGVERIFY, name: "OP_CHECKMULTISIGVERIFY", length: 1, OP_CHECKMULTISIGVERIFY: {value: OP_CHECKMULTISIGVERIFY, name: "OP_CHECKMULTISIGVERIFY", length: 1,

View file

@ -381,7 +381,7 @@ var opcodeTests = []opcodeTest{
0xa7, 0xdf, 0x5f, 0x14, 0x2c, 0x21, 0xc1, 0xb7, 0x30, 0x3b, 0xa7, 0xdf, 0x5f, 0x14, 0x2c, 0x21, 0xc1, 0xb7, 0x30, 0x3b,
0x8a, 0x06, 0x26, 0xf1, 0xba, 0xde, 0xd5, 0xc7, 0x2a, 0x70, 0x8a, 0x06, 0x26, 0xf1, 0xba, 0xde, 0xd5, 0xc7, 0x2a, 0x70,
0x4f, 0x7e, 0x6c, 0xd8, 0x4c, 0x4f, 0x7e, 0x6c, 0xd8, 0x4c,
btcscript.OP_1, btcscript.OP_CHECK_MULTISIG}, btcscript.OP_1, btcscript.OP_CHECKMULTISIG},
canonical: false, canonical: false,
shouldPass: false}, shouldPass: false},
{script: []byte{btcscript.OP_1, btcscript.OP_1, btcscript.OP_DATA_65, {script: []byte{btcscript.OP_1, btcscript.OP_1, btcscript.OP_DATA_65,
@ -392,7 +392,7 @@ var opcodeTests = []opcodeTest{
0xa7, 0xdf, 0x5f, 0x14, 0x2c, 0x21, 0xc1, 0xb7, 0x30, 0x3b, 0xa7, 0xdf, 0x5f, 0x14, 0x2c, 0x21, 0xc1, 0xb7, 0x30, 0x3b,
0x8a, 0x06, 0x26, 0xf1, 0xba, 0xde, 0xd5, 0xc7, 0x2a, 0x70, 0x8a, 0x06, 0x26, 0xf1, 0xba, 0xde, 0xd5, 0xc7, 0x2a, 0x70,
0x4f, 0x7e, 0x6c, 0xd8, 0x4c, 0x4f, 0x7e, 0x6c, 0xd8, 0x4c,
btcscript.OP_1, btcscript.OP_CHECK_MULTISIG}, btcscript.OP_1, btcscript.OP_CHECKMULTISIG},
canonical: true, canonical: true,
shouldPass: false}, shouldPass: false},
/* up here because no defined error case. */ /* up here because no defined error case. */
@ -2162,44 +2162,44 @@ var detailedTests = []detailedTest{
nPreciseSigOps: 1, nPreciseSigOps: 1,
}, },
{ {
name: "OP_CHECK_MULTISIG no args", name: "OP_CHECKMULTISIG no args",
script: []byte{btcscript.OP_CHECK_MULTISIG}, script: []byte{btcscript.OP_CHECKMULTISIG},
expectedReturn: btcscript.StackErrUnderflow, expectedReturn: btcscript.StackErrUnderflow,
disassembly: "OP_CHECK_MULTISIG", disassembly: "OP_CHECKMULTISIG",
nSigOps: 20, nSigOps: 20,
nPreciseSigOps: 20, nPreciseSigOps: 20,
}, },
{ {
name: "OP_CHECK_MULTISIG huge number", name: "OP_CHECKMULTISIG huge number",
script: []byte{btcscript.OP_PUSHDATA1, script: []byte{btcscript.OP_PUSHDATA1,
0x9, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x9, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9,
btcscript.OP_CHECK_MULTISIG}, btcscript.OP_CHECKMULTISIG},
expectedReturn: btcscript.StackErrNumberTooBig, expectedReturn: btcscript.StackErrNumberTooBig,
disassembly: "010203040506070809 OP_CHECK_MULTISIG", disassembly: "010203040506070809 OP_CHECKMULTISIG",
nSigOps: 20, nSigOps: 20,
nPreciseSigOps: 20, nPreciseSigOps: 20,
}, },
{ {
name: "OP_CHECK_MULTISIG too many keys", name: "OP_CHECKMULTISIG too many keys",
script: []byte{btcscript.OP_DATA_1, 21, script: []byte{btcscript.OP_DATA_1, 21,
btcscript.OP_CHECK_MULTISIG}, btcscript.OP_CHECKMULTISIG},
expectedReturn: btcscript.StackErrTooManyPubkeys, expectedReturn: btcscript.StackErrTooManyPubkeys,
disassembly: "15 OP_CHECK_MULTISIG", disassembly: "15 OP_CHECKMULTISIG",
nSigOps: 20, nSigOps: 20,
nPreciseSigOps: 20, nPreciseSigOps: 20,
}, },
{ {
name: "OP_CHECK_MULTISIG lying about pubkeys", name: "OP_CHECKMULTISIG lying about pubkeys",
script: []byte{btcscript.OP_1, script: []byte{btcscript.OP_1,
btcscript.OP_CHECK_MULTISIG}, btcscript.OP_CHECKMULTISIG},
expectedReturn: btcscript.StackErrUnderflow, expectedReturn: btcscript.StackErrUnderflow,
disassembly: "OP_1 OP_CHECK_MULTISIG", disassembly: "OP_1 OP_CHECKMULTISIG",
nSigOps: 20, nSigOps: 20,
nPreciseSigOps: 1, nPreciseSigOps: 1,
}, },
{ {
// pubkey comes from blockchain // pubkey comes from blockchain
name: "OP_CHECK_MULTISIG no sigs", name: "OP_CHECKMULTISIG no sigs",
script: []byte{ script: []byte{
btcscript.OP_DATA_65, btcscript.OP_DATA_65,
0x04, 0xae, 0x1a, 0x62, 0xfe, 0x09, 0xc5, 0xf5, 0x1b, 0x04, 0xae, 0x1a, 0x62, 0xfe, 0x09, 0xc5, 0xf5, 0x1b,
@ -2211,15 +2211,15 @@ var detailedTests = []detailedTest{
0xba, 0xde, 0xd5, 0xc7, 0x2a, 0x70, 0x4f, 0x7e, 0x6c, 0xba, 0xde, 0xd5, 0xc7, 0x2a, 0x70, 0x4f, 0x7e, 0x6c,
0xd8, 0x4c, 0xd8, 0x4c,
btcscript.OP_1, btcscript.OP_1,
btcscript.OP_CHECK_MULTISIG}, btcscript.OP_CHECKMULTISIG},
expectedReturn: btcscript.StackErrUnderflow, expectedReturn: btcscript.StackErrUnderflow,
disassembly: "04ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84c OP_1 OP_CHECK_MULTISIG", disassembly: "04ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84c OP_1 OP_CHECKMULTISIG",
nSigOps: 20, nSigOps: 20,
nPreciseSigOps: 1, nPreciseSigOps: 1,
}, },
{ {
// pubkey comes from blockchain // pubkey comes from blockchain
name: "OP_CHECK_MULTISIG sigs huge no", name: "OP_CHECKMULTISIG sigs huge no",
script: []byte{ script: []byte{
btcscript.OP_PUSHDATA1, btcscript.OP_PUSHDATA1,
0x9, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x9, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9,
@ -2233,14 +2233,14 @@ var detailedTests = []detailedTest{
0xba, 0xde, 0xd5, 0xc7, 0x2a, 0x70, 0x4f, 0x7e, 0x6c, 0xba, 0xde, 0xd5, 0xc7, 0x2a, 0x70, 0x4f, 0x7e, 0x6c,
0xd8, 0x4c, 0xd8, 0x4c,
btcscript.OP_1, btcscript.OP_1,
btcscript.OP_CHECK_MULTISIG}, btcscript.OP_CHECKMULTISIG},
expectedReturn: btcscript.StackErrNumberTooBig, expectedReturn: btcscript.StackErrNumberTooBig,
disassembly: "010203040506070809 04ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84c OP_1 OP_CHECK_MULTISIG", disassembly: "010203040506070809 04ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84c OP_1 OP_CHECKMULTISIG",
nSigOps: 20, nSigOps: 20,
nPreciseSigOps: 1, nPreciseSigOps: 1,
}, },
{ {
name: "OP_CHECK_MULTISIG too few sigs", name: "OP_CHECKMULTISIG too few sigs",
script: []byte{btcscript.OP_1, script: []byte{btcscript.OP_1,
btcscript.OP_DATA_65, btcscript.OP_DATA_65,
0x04, 0xae, 0x1a, 0x62, 0xfe, 0x09, 0xc5, 0xf5, 0x1b, 0x04, 0xae, 0x1a, 0x62, 0xfe, 0x09, 0xc5, 0xf5, 0x1b,
@ -2252,15 +2252,15 @@ var detailedTests = []detailedTest{
0xba, 0xde, 0xd5, 0xc7, 0x2a, 0x70, 0x4f, 0x7e, 0x6c, 0xba, 0xde, 0xd5, 0xc7, 0x2a, 0x70, 0x4f, 0x7e, 0x6c,
0xd8, 0x4c, 0xd8, 0x4c,
btcscript.OP_1, btcscript.OP_1,
btcscript.OP_CHECK_MULTISIG}, btcscript.OP_CHECKMULTISIG},
expectedReturn: btcscript.StackErrUnderflow, expectedReturn: btcscript.StackErrUnderflow,
disassembly: "OP_1 04ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84c OP_1 OP_CHECK_MULTISIG", disassembly: "OP_1 04ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84c OP_1 OP_CHECKMULTISIG",
nSigOps: 20, nSigOps: 20,
nPreciseSigOps: 1, nPreciseSigOps: 1,
}, },
{ {
// pubkey and sig comes from blockchain, are unrelated // pubkey and sig comes from blockchain, are unrelated
name: "OP_CHECK_MULTISIG won't verify", name: "OP_CHECKMULTISIG won't verify",
script: []byte{btcscript.OP_1, script: []byte{btcscript.OP_1,
btcscript.OP_DATA_71, btcscript.OP_DATA_71,
0x30, 0x44, 0x02, 0x20, 0x4e, 0x45, 0xe1, 0x69, 0x32, 0x30, 0x44, 0x02, 0x20, 0x4e, 0x45, 0xe1, 0x69, 0x32,
@ -2282,9 +2282,9 @@ var detailedTests = []detailedTest{
0xba, 0xde, 0xd5, 0xc7, 0x2a, 0x70, 0x4f, 0x7e, 0x6c, 0xba, 0xde, 0xd5, 0xc7, 0x2a, 0x70, 0x4f, 0x7e, 0x6c,
0xd8, 0x4c, 0xd8, 0x4c,
btcscript.OP_1, btcscript.OP_1,
btcscript.OP_CHECK_MULTISIG}, btcscript.OP_CHECKMULTISIG},
after: [][]byte{{0}}, after: [][]byte{{0}},
disassembly: "OP_1 304402204e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd410220181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d0901 OP_1 04ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84c OP_1 OP_CHECK_MULTISIG", disassembly: "OP_1 304402204e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd410220181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d0901 OP_1 04ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84c OP_1 OP_CHECKMULTISIG",
nSigOps: 20, nSigOps: 20,
nPreciseSigOps: 1, nPreciseSigOps: 1,
}, },
@ -2292,7 +2292,7 @@ var detailedTests = []detailedTest{
// invalid pubkey means that it fails to validate, not an // invalid pubkey means that it fails to validate, not an
// error. There are pubkeys in the blockchain that don't // error. There are pubkeys in the blockchain that don't
// parse with any validity. // parse with any validity.
name: "OP_CHECK_MULTISIG sigs bad pubkey", name: "OP_CHECKMULTISIG sigs bad pubkey",
script: []byte{btcscript.OP_1, script: []byte{btcscript.OP_1,
btcscript.OP_DATA_71, btcscript.OP_DATA_71,
0x30, 0x44, 0x02, 0x20, 0x4e, 0x45, 0xe1, 0x69, 0x32, 0x30, 0x44, 0x02, 0x20, 0x4e, 0x45, 0xe1, 0x69, 0x32,
@ -2305,9 +2305,9 @@ var detailedTests = []detailedTest{
0x22, 0x21, 0xa8, 0x76, 0x8d, 0x1d, 0x09, 0x01, 0x22, 0x21, 0xa8, 0x76, 0x8d, 0x1d, 0x09, 0x01,
btcscript.OP_1, btcscript.OP_1,
btcscript.OP_1, btcscript.OP_1, btcscript.OP_1, btcscript.OP_1,
btcscript.OP_CHECK_MULTISIG}, btcscript.OP_CHECKMULTISIG},
after: [][]byte{{0}}, after: [][]byte{{0}},
disassembly: "OP_1 304402204e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd410220181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d0901 OP_1 OP_1 OP_1 OP_CHECK_MULTISIG", disassembly: "OP_1 304402204e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd410220181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d0901 OP_1 OP_1 OP_1 OP_CHECKMULTISIG",
nSigOps: 20, nSigOps: 20,
nPreciseSigOps: 1, nPreciseSigOps: 1,
}, },
@ -3090,10 +3090,10 @@ var detailedTests = []detailedTest{
btcscript.OP_1, btcscript.OP_1,
btcscript.OP_1, btcscript.OP_1,
btcscript.OP_2, btcscript.OP_2,
btcscript.OP_CHECK_MULTISIG, btcscript.OP_CHECKMULTISIG,
}, },
expectedReturn: btcscript.StackErrTooManyOperations, expectedReturn: btcscript.StackErrTooManyOperations,
disassembly: "OP_1 OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_1 OP_1 OP_1 OP_1 OP_2 OP_CHECK_MULTISIG", disassembly: "OP_1 OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_1 OP_1 OP_1 OP_1 OP_2 OP_CHECKMULTISIG",
nSigOps: 20, nSigOps: 20,
nPreciseSigOps: 2, nPreciseSigOps: 2,
}, },

View file

@ -237,7 +237,7 @@ func IsPayToScriptHash(script []byte) bool {
func isMultiSig(pops []parsedOpcode) bool { func isMultiSig(pops []parsedOpcode) bool {
l := len(pops) l := len(pops)
// absolute minimum is 1 pubkey so // absolute minimum is 1 pubkey so
// OP_1-16, pubkey, OP_1, OP_CHECK_MULTISIG // OP_1-16, pubkey, OP_1, OP_CHECKMULTISIG
if l < 4 { if l < 4 {
return false return false
} }
@ -249,7 +249,7 @@ func isMultiSig(pops []parsedOpcode) bool {
pops[l-2].opcode.value > OP_16 { pops[l-2].opcode.value > OP_16 {
return false return false
} }
if pops[l-1].opcode.value != OP_CHECK_MULTISIG { if pops[l-1].opcode.value != OP_CHECKMULTISIG {
return false return false
} }
for _, pop := range pops[1 : l-2] { for _, pop := range pops[1 : l-2] {
@ -936,7 +936,7 @@ func getSigOpCount(pops []parsedOpcode, precise bool) int {
fallthrough fallthrough
case OP_CHECKSIGVERIFY: case OP_CHECKSIGVERIFY:
nSigs++ nSigs++
case OP_CHECK_MULTISIG: case OP_CHECKMULTISIG:
fallthrough fallthrough
case OP_CHECKMULTISIGVERIFY: case OP_CHECKMULTISIGVERIFY:
// If we are being precise then look for familiar // If we are being precise then look for familiar

View file

@ -958,7 +958,7 @@ var txTests = []txTest{
0x78, 0x86, 0x21, 0x1a, 0xb4, 0x78, 0x86, 0x21, 0x1a, 0xb4,
0x14, 0xd5, 0x5a, 0x14, 0xd5, 0x5a,
btcscript.OP_TRUE, btcscript.OP_TRUE,
btcscript.OP_CHECK_MULTISIG, btcscript.OP_CHECKMULTISIG,
}, },
Sequence: 4294967295, Sequence: 4294967295,
}, },
@ -1081,7 +1081,7 @@ var txTests = []txTest{
0x78, 0x86, 0x21, 0x1a, 0xb4, 0x78, 0x86, 0x21, 0x1a, 0xb4,
0x14, 0xd5, 0x5a, 0x14, 0xd5, 0x5a,
btcscript.OP_TRUE, btcscript.OP_TRUE,
btcscript.OP_CHECK_MULTISIG, btcscript.OP_CHECKMULTISIG,
}, },
Sequence: 4294967295, Sequence: 4294967295,
}, },
@ -1711,7 +1711,7 @@ func TestScriptInfo(t *testing.T) {
0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12,
0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a,
0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21,
btcscript.OP_3, btcscript.OP_CHECK_MULTISIG, btcscript.OP_3, btcscript.OP_CHECKMULTISIG,
}, },
bip16: true, bip16: true,
scriptInfo: btcscript.ScriptInfo{ scriptInfo: btcscript.ScriptInfo{
@ -1990,7 +1990,7 @@ var scriptTypeTests = []scriptTypeTest{
0x45, 0x32, 0x9a, 0x00, 0x35, 0x7b, 0x3a, 0x78, 0x86, 0x45, 0x32, 0x9a, 0x00, 0x35, 0x7b, 0x3a, 0x78, 0x86,
0x21, 0x1a, 0xb4, 0x14, 0xd5, 0x5a, 0x21, 0x1a, 0xb4, 0x14, 0xd5, 0x5a,
btcscript.OP_TRUE, btcscript.OP_TRUE,
btcscript.OP_CHECK_MULTISIG, btcscript.OP_CHECKMULTISIG,
}, },
scripttype: btcscript.MultiSigTy, scripttype: btcscript.MultiSigTy,
}, },
@ -2091,7 +2091,7 @@ var scriptTypeTests = []scriptTypeTest{
0x45, 0x32, 0x9a, 0x00, 0x35, 0x7b, 0x3a, 0x78, 0x86, 0x45, 0x32, 0x9a, 0x00, 0x35, 0x7b, 0x3a, 0x78, 0x86,
0x21, 0x1a, 0xb4, 0x14, 0xd5, 0x5a, 0x21, 0x1a, 0xb4, 0x14, 0xd5, 0x5a,
btcscript.OP_TRUE, btcscript.OP_TRUE,
btcscript.OP_CHECK_MULTISIG, btcscript.OP_CHECKMULTISIG,
}, },
scripttype: btcscript.NonStandardTy, scripttype: btcscript.NonStandardTy,
}, },
@ -2102,7 +2102,7 @@ var scriptTypeTests = []scriptTypeTest{
btcscript.OP_TRUE, btcscript.OP_TRUE,
btcscript.OP_TRUE, btcscript.OP_TRUE,
btcscript.OP_TRUE, btcscript.OP_TRUE,
btcscript.OP_CHECK_MULTISIG, btcscript.OP_CHECKMULTISIG,
}, },
scripttype: btcscript.NonStandardTy, scripttype: btcscript.NonStandardTy,
}, },
@ -2122,7 +2122,7 @@ var scriptTypeTests = []scriptTypeTest{
0x45, 0x32, 0x9a, 0x00, 0x35, 0x7b, 0x3a, 0x78, 0x86, 0x45, 0x32, 0x9a, 0x00, 0x35, 0x7b, 0x3a, 0x78, 0x86,
0x21, 0x1a, 0xb4, 0x14, 0xd5, 0x5a, 0x21, 0x1a, 0xb4, 0x14, 0xd5, 0x5a,
// No number. // No number.
btcscript.OP_CHECK_MULTISIG, btcscript.OP_CHECKMULTISIG,
}, },
scripttype: btcscript.NonStandardTy, scripttype: btcscript.NonStandardTy,
}, },
@ -2146,7 +2146,7 @@ var scriptTypeTests = []scriptTypeTest{
// multisig but wrong length. // multisig but wrong length.
script: []byte{ script: []byte{
btcscript.OP_TRUE, btcscript.OP_TRUE,
btcscript.OP_CHECK_MULTISIG, btcscript.OP_CHECKMULTISIG,
}, },
scripttype: btcscript.NonStandardTy, scripttype: btcscript.NonStandardTy,
}, },