diff options
author | fanquake <fanquake@gmail.com> | 2020-09-04 19:53:55 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2020-09-04 20:11:47 +0800 |
commit | 30926997fa157133b403b73d000a75ab06802f41 (patch) | |
tree | 34b352ecdbec8e4a14fd76cc0800adb436a4eb7f /src/policy/policy.cpp | |
parent | bf0dc356ac4a2bdeda1908af021dea2de0dfb35a (diff) | |
parent | 107cf1515e69ee773ad1bcc1d5b6fffa49b78750 (diff) |
Merge #19680: 0.20: Add txids with non-standard inputs to reject filter
107cf1515e69ee773ad1bcc1d5b6fffa49b78750 test addition of unknown segwit spends to txid reject filter (Gregory Sanders)
06f9c5c3be43bb9e4703ba120c9cb35de0736b54 Add txids with non-standard inputs to reject filter (Suhas Daftuar)
Pull request description:
Backport of #19620 to 0.20.
ACKs for top commit:
instagibbs:
utACK https://github.com/bitcoin/bitcoin/pull/19680/commits/107cf1515e69ee773ad1bcc1d5b6fffa49b78750
fjahr:
utACK 107cf1515e69ee773ad1bcc1d5b6fffa49b78750
jnewbery:
utACK 107cf1515e69ee773ad1bcc1d5b6fffa49b78750
Tree-SHA512: d89c75fefdb6b50f40adfcf3cfdb2a791122e4d6a5903cb553c664042963577beb97a73319f9d1cb8320d32846778233c95255812c37fb4c7b1b25da161a6595
Diffstat (limited to 'src/policy/policy.cpp')
-rw-r--r-- | src/policy/policy.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/policy/policy.cpp b/src/policy/policy.cpp index 07d51c0088..a0ac6bdd83 100644 --- a/src/policy/policy.cpp +++ b/src/policy/policy.cpp @@ -152,6 +152,8 @@ bool IsStandardTx(const CTransaction& tx, bool permit_bare_multisig, const CFeeR * script can be anything; an attacker could use a very * expensive-to-check-upon-redemption script like: * DUP CHECKSIG DROP ... repeated 100 times... OP_1 + * + * Note that only the non-witness portion of the transaction is checked here. */ bool AreInputsStandard(const CTransaction& tx, const CCoinsViewCache& mapInputs) { @@ -164,7 +166,11 @@ bool AreInputsStandard(const CTransaction& tx, const CCoinsViewCache& mapInputs) std::vector<std::vector<unsigned char> > vSolutions; txnouttype whichType = Solver(prev.scriptPubKey, vSolutions); - if (whichType == TX_NONSTANDARD) { + if (whichType == TX_NONSTANDARD || whichType == TX_WITNESS_UNKNOWN) { + // WITNESS_UNKNOWN failures are typically also caught with a policy + // flag in the script interpreter, but it can be helpful to catch + // this type of NONSTANDARD transaction earlier in transaction + // validation. return false; } else if (whichType == TX_SCRIPTHASH) { std::vector<std::vector<unsigned char> > stack; |