diff options
author | Johnson Lau <jl2012@xbt.hk> | 2018-04-27 03:31:36 +0800 |
---|---|---|
committer | Johnson Lau <jl2012@xbt.hk> | 2018-05-05 04:26:13 +0800 |
commit | 7485488e907e236133a016ba7064c89bf9ab6da3 (patch) | |
tree | a0a9edf5d749f6f89510b51ece2b152d7d8cf0e2 /src/policy | |
parent | 0f8719bb035187076eeac025e2c786feb0f452d7 (diff) |
Policy to reject extremely small transactions
A transaction with 1 segwit input and 1 P2WPHK output has non-witness size of 82 bytes. Anything smaller than this have unnecessary malloc overhead and are not relayed/mined.
Diffstat (limited to 'src/policy')
-rw-r--r-- | src/policy/policy.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/policy/policy.h b/src/policy/policy.h index 6ba3ba7450..5ce019df4c 100644 --- a/src/policy/policy.h +++ b/src/policy/policy.h @@ -22,6 +22,8 @@ static const unsigned int DEFAULT_BLOCK_MAX_WEIGHT = MAX_BLOCK_WEIGHT - 4000; static const unsigned int DEFAULT_BLOCK_MIN_TX_FEE = 1000; /** The maximum weight for transactions we're willing to relay/mine */ static const 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 const unsigned int MIN_STANDARD_TX_NONWITNESS_SIZE = 82; /** Maximum number of signature check operations in an IsStandard() P2SH script */ static const unsigned int MAX_P2SH_SIGOPS = 15; /** The maximum number of sigops we're willing to relay/mine in a single tx */ |