Raise maxStandardSigScriptSize to 1650.
This commit raises the maximum allowed size for a standard signature script to cover a 15-of-15 multi-signature pay-to-script-hash with compressed pubkeys. This mirrors a recent change to remain compatible with Bitcoin Core. ok @owinga who also helped verify and correct the script math. Closes #128.
This commit is contained in:
parent
bcc78565fd
commit
6d8b873923
1 changed files with 16 additions and 6 deletions
22
mempool.go
22
mempool.go
|
@ -53,12 +53,22 @@ const (
|
|||
|
||||
// maxStandardSigScriptSize is the maximum size allowed for a
|
||||
// transaction input signature script to be considered standard. This
|
||||
// value allows for a CHECKMULTISIG pay-to-sript-hash with 3 signatures
|
||||
// since each signature is about 80-bytes, the 3 corresponding public
|
||||
// keys are 65-bytes each if uncompressed, and the script opcodes take
|
||||
// a few extra bytes. This value also adds a few extra bytes for
|
||||
// prosperity. 3*80 + 3*65 + 65 = 500
|
||||
maxStandardSigScriptSize = 500
|
||||
// value allows for a 15-of-15 CHECKMULTISIG pay-to-script-hash with
|
||||
// compressed keys.
|
||||
//
|
||||
// The form of the overall script is: OP_0 <15 signatures> OP_PUSHDATA2
|
||||
// <2 bytes len> [OP_15 <15 pubkeys> OP_15 OP_CHECKMULTISIG]
|
||||
//
|
||||
// For the p2sh script portion, each of the 15 compressed pubkeys are
|
||||
// 33 bytes (plus one for the OP_DATA_33 opcode), and the thus it totals
|
||||
// to (15*34)+3 = 513 bytes. Next, each of the 15 signatures is a max
|
||||
// of 73 bytes (plus one for the OP_DATA_73 opcode). Also, there is one
|
||||
// extra byte for the initial extra OP_0 push and 3 bytes for the
|
||||
// OP_PUSHDATA2 needed to specify the 513 bytes for the script push.
|
||||
// That brings the total to 1+(15*74)+3+513 = 1627. This value also
|
||||
// adds a few extra bytes to provide a little buffer.
|
||||
// (1 + 15*74 + 3) + (15*34 + 3) + 23 = 1650
|
||||
maxStandardSigScriptSize = 1650
|
||||
|
||||
// maxStandardMultiSigKeys is the maximum number of public keys allowed
|
||||
// in a multi-signature transaction output script for it to be
|
||||
|
|
Loading…
Reference in a new issue