diff options
author | Peter Todd <pete@petertodd.org> | 2014-10-13 10:18:05 -0400 |
---|---|---|
committer | Jorge Timón <jtimon@jtimon.cc> | 2015-10-01 18:28:13 +0200 |
commit | da894ab5da222ad317039eb008ec6443fb9113d9 (patch) | |
tree | 391ecd1cf9ea432a1558ae2e70d9a1fbb91d5dd3 /src/policy/policy.cpp | |
parent | 5d8709c3b7fcc66fbf537ec0b6c1a98d69214e25 (diff) |
Accept any sequence of PUSHDATAs in OP_RETURN outputs
Previously only one PUSHDATA was allowed, needlessly limiting
applications such as matching OP_RETURN contents with bloom filters that
operate on a per-PUSHDATA level. Now any combination that passes
IsPushOnly() is allowed, so long as the total size of the scriptPubKey
is less than 42 bytes. (unchanged modulo non-minimal PUSHDATA encodings)
Also, this fixes the odd bug where previously the PUSHDATA could be
replaced by any single opcode, even sigops consuming opcodes such as
CHECKMULTISIG. (20 sigops!)
Diffstat (limited to 'src/policy/policy.cpp')
-rw-r--r-- | src/policy/policy.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/policy/policy.cpp b/src/policy/policy.cpp index 169fef4af4..4c96fbf5a5 100644 --- a/src/policy/policy.cpp +++ b/src/policy/policy.cpp @@ -49,7 +49,9 @@ bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType) return false; if (m < 1 || m > n) return false; - } + } else if (whichType == TX_NULL_DATA && + (!GetBoolArg("-datacarrier", true) || scriptPubKey.size() > nMaxDatacarrierBytes)) + return false; return whichType != TX_NONSTANDARD; } |