@ -582,6 +582,12 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
if ( fRequireStandard & & ! IsStandardTx ( tx , reason , witnessEnabled ) )
return state . DoS ( 0 , false , REJECT_NONSTANDARD , reason ) ;
// Do not work on transactions that are too small.
// A transaction with 1 segwit input and 1 P2WPHK output has non-witness size of 82 bytes.
// Transactions smaller than this are not relayed to reduce unnecessary malloc overhead.
if ( : : GetSerializeSize ( tx , SER_NETWORK , PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS ) < MIN_STANDARD_TX_NONWITNESS_SIZE )
return state . DoS ( 0 , false , REJECT_NONSTANDARD , " tx-size-small " ) ;
// Only accept nLockTime-using transactions that can be mined in the next
// block; we don't want our mempool filled up with transactions that can't
// be mined yet.