diff options
author | Greg Sanders <gsanders87@gmail.com> | 2022-10-05 14:50:30 -0400 |
---|---|---|
committer | Greg Sanders <gsanders87@gmail.com> | 2022-12-19 10:03:51 -0500 |
commit | 8c5b3646b5afe8a61f5c66478d8e11f0d2ce5108 (patch) | |
tree | 8925907b89fa1a534f2548166288bdaaf5a211b2 /src/policy/policy.h | |
parent | 9ca39d69dfe03c19662867c3d53a5e6e41277d4a (diff) | |
download | bitcoin-8c5b3646b5afe8a61f5c66478d8e11f0d2ce5108.tar.xz |
Relax MIN_STANDARD_TX_NONWITNESS_SIZE to 65 non-witness bytes
Since the original fix was set to be a "reasonable" transaction
to reduce allocations and the true motivation later revealed,
it makes sense to relax this check to something more principled.
There are more exotic transaction patterns that could take advantage
of a relaxed requirement, such as 1 input, 1 output OP_RETURN to burn
a utxo to fees for CPFP purposes when change isn't practical.
Two changes could be accomplished:
1) Anything not 64 bytes could be allowed
2) Anything above 64 bytes could be allowed
In the Great Consensus Cleanup, suggestion (2) was the route taken.
It would not allow an "empty" OP_RETURN
but would reduce the required padding from 22 bytes to 5.
The functional test is also modified to test the actual case
we care about: 64 bytes
Diffstat (limited to 'src/policy/policy.h')
-rw-r--r-- | src/policy/policy.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/policy/policy.h b/src/policy/policy.h index 29764ea2d9..8a26e70ef4 100644 --- a/src/policy/policy.h +++ b/src/policy/policy.h @@ -25,8 +25,8 @@ static constexpr unsigned int DEFAULT_BLOCK_MAX_WEIGHT{MAX_BLOCK_WEIGHT - 4000}; static constexpr unsigned int DEFAULT_BLOCK_MIN_TX_FEE{1000}; /** The maximum weight for transactions we're willing to relay/mine */ static constexpr unsigned int MAX_STANDARD_TX_WEIGHT{400000}; -/** The minimum non-witness size for transactions we're willing to relay/mine (1 segwit input + 1 P2WPKH output = 82 bytes) */ -static constexpr unsigned int MIN_STANDARD_TX_NONWITNESS_SIZE{82}; +/** The minimum non-witness size for transactions we're willing to relay/mine: one larger than 64 */ +static constexpr unsigned int MIN_STANDARD_TX_NONWITNESS_SIZE{65}; /** Maximum number of signature check operations in an IsStandard() P2SH script */ static constexpr unsigned int MAX_P2SH_SIGOPS{15}; /** The maximum number of sigops we're willing to relay/mine in a single tx */ |