diff --git a/src/bench/block_assemble.cpp b/src/bench/block_assemble.cpp --- a/src/bench/block_assemble.cpp +++ b/src/bench/block_assemble.cpp @@ -55,8 +55,7 @@ TxValidationState vstate; bool ret{::AcceptToMemoryPool(config, *test_setup.m_node.mempool, vstate, txr, - false /* bypass_limits */, - /* nAbsurdFee */ Amount::zero())}; + false /* bypass_limits */)}; assert(ret); } } diff --git a/src/net_processing.cpp b/src/net_processing.cpp --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -2568,8 +2568,7 @@ TxValidationState state; if (AcceptToMemoryPool(config, m_mempool, state, porphanTx, - false /* bypass_limits */, - Amount::zero() /* nAbsurdFee */)) { + false /* bypass_limits */)) { LogPrint(BCLog::MEMPOOL, " accepted orphan tx %s\n", orphanTxId.ToString()); RelayTransaction(orphanTxId, m_connman); @@ -3643,8 +3642,7 @@ if (!AlreadyHaveTx(txid, m_mempool) && AcceptToMemoryPool(config, m_mempool, state, ptx, - false /* bypass_limits */, - Amount::zero() /* nAbsurdFee */)) { + false /* bypass_limits */)) { m_mempool.check(&::ChainstateActive().CoinsTip()); // As this version of the transaction was acceptable, we can forget // about any requests for it. diff --git a/src/node/transaction.cpp b/src/node/transaction.cpp --- a/src/node/transaction.cpp +++ b/src/node/transaction.cpp @@ -67,11 +67,9 @@ // First, call ATMP with test_accept and check the fee. If ATMP // fails here, return error immediately. Amount fee = Amount::zero(); - if (!AcceptToMemoryPool( - config, *node.mempool, state, tx, - false /* bypass_limits */, - /* absurdfee */ Amount::zero(), /* test_accept */ - true, &fee)) { + if (!AcceptToMemoryPool(config, *node.mempool, state, tx, + false /* bypass_limits */, + /* test_accept */ true, &fee)) { return HandleATMPError(state, err_string); } else if (fee > max_tx_fee) { return TransactionError::MAX_FEE_EXCEEDED; @@ -79,7 +77,7 @@ } // Try to submit the transaction to the mempool. if (!AcceptToMemoryPool(config, *node.mempool, state, tx, - false /* bypass_limits */, max_tx_fee)) { + false /* bypass_limits */)) { return HandleATMPError(state, err_string); } diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -1152,8 +1152,7 @@ LOCK(cs_main); test_accept_res = AcceptToMemoryPool( config, mempool, state, std::move(tx), - false /* bypass_limits */, max_raw_tx_fee, - true /* test_accept */, &fee); + false /* bypass_limits */, true /* test_accept */, &fee); } // Check that fee does not exceed maximum fee diff --git a/src/test/txvalidation_tests.cpp b/src/test/txvalidation_tests.cpp --- a/src/test/txvalidation_tests.cpp +++ b/src/test/txvalidation_tests.cpp @@ -41,8 +41,7 @@ BOOST_CHECK_EQUAL(false, AcceptToMemoryPool(GetConfig(), *m_node.mempool, state, MakeTransactionRef(coinbaseTx), - true /* bypass_limits */, - Amount::zero() /* nAbsurdFee */)); + true /* bypass_limits */)); // Check that the transaction hasn't been added to mempool. BOOST_CHECK_EQUAL(m_node.mempool->size(), initialPoolSize); diff --git a/src/test/txvalidationcache_tests.cpp b/src/test/txvalidationcache_tests.cpp --- a/src/test/txvalidationcache_tests.cpp +++ b/src/test/txvalidationcache_tests.cpp @@ -33,9 +33,9 @@ LOCK(cs_main); TxValidationState state; - return AcceptToMemoryPool( - GetConfig(), *m_node.mempool, state, MakeTransactionRef(tx), - true /* bypass_limits */, Amount::zero() /* nAbsurdFee */); + return AcceptToMemoryPool(GetConfig(), *m_node.mempool, state, + MakeTransactionRef(tx), + true /* bypass_limits */); }; // Create a double-spend of mature coinbase txn: diff --git a/src/test/validation_block_tests.cpp b/src/test/validation_block_tests.cpp --- a/src/test/validation_block_tests.cpp +++ b/src/test/validation_block_tests.cpp @@ -332,8 +332,7 @@ for (const auto &tx : txs) { BOOST_REQUIRE_MESSAGE( AcceptToMemoryPool(config, *m_node.mempool, state, tx, - /* bypass_limits */ false, - /* nAbsurdFee */ Amount::zero()), + /* bypass_limits */ false), state.GetRejectReason()); } } diff --git a/src/txmempool.cpp b/src/txmempool.cpp --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -1415,8 +1415,7 @@ TxValidationState stateDummy; if (!fAddToMempool || tx->IsCoinBase() || !AcceptToMemoryPool(config, pool, stateDummy, tx, - true /* bypass_limits */, - Amount::zero() /* nAbsurdFee */)) { + true /* bypass_limits */)) { // If the transaction doesn't make it in to the mempool, remove any // transactions that depend on it (which would now be orphans). pool.removeRecursive(*tx, MemPoolRemovalReason::REORG); diff --git a/src/validation.h b/src/validation.h --- a/src/validation.h +++ b/src/validation.h @@ -289,8 +289,8 @@ */ bool AcceptToMemoryPool(const Config &config, CTxMemPool &pool, TxValidationState &state, const CTransactionRef &tx, - bool bypass_limits, const Amount nAbsurdFee, - bool test_accept = false, Amount *fee_out = nullptr) + bool bypass_limits, bool test_accept = false, + Amount *fee_out = nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs_main); /** diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -358,7 +358,6 @@ TxValidationState &m_state; const int64_t m_accept_time; const bool m_bypass_limits; - const Amount &m_absurd_fee; /* * Return any outpoints which were not previously present in the coins * cache, but were added as a result of validating the tx for mempool @@ -443,7 +442,6 @@ TxValidationState &state = args.m_state; const int64_t nAcceptTime = args.m_accept_time; const bool bypass_limits = args.m_bypass_limits; - const Amount &nAbsurdFee = args.m_absurd_fee; std::vector &coins_to_uncache = args.m_coins_to_uncache; // Alias what we need out of ws @@ -595,10 +593,6 @@ strprintf("%d < %d", nModifiedFees, ::minRelayTxFee.GetFee(nSize))); } - if (nAbsurdFee != Amount::zero() && nFees > nAbsurdFee) { - LogPrintf("Ignoring Absurdfee\n"); - } - // Validate input scripts against standard script flags. const uint32_t scriptVerifyFlags = ws.m_next_block_script_verify_flags | STANDARD_SCRIPT_VERIFY_FLAGS; @@ -750,16 +744,17 @@ /** * (try to) add transaction to memory pool with a specified acceptance time. */ -static bool AcceptToMemoryPoolWithTime( - const Config &config, CTxMemPool &pool, TxValidationState &state, - const CTransactionRef &tx, int64_t nAcceptTime, bool bypass_limits, - const Amount nAbsurdFee, bool test_accept, Amount *fee_out = nullptr) +static bool +AcceptToMemoryPoolWithTime(const Config &config, CTxMemPool &pool, + TxValidationState &state, const CTransactionRef &tx, + int64_t nAcceptTime, bool bypass_limits, + bool test_accept, Amount *fee_out = nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs_main) { AssertLockHeld(cs_main); std::vector coins_to_uncache; - MemPoolAccept::ATMPArgs args{config, state, nAcceptTime, - bypass_limits, nAbsurdFee, coins_to_uncache, - test_accept, fee_out}; + MemPoolAccept::ATMPArgs args{ + config, state, nAcceptTime, bypass_limits, + coins_to_uncache, test_accept, fee_out}; bool res = MemPoolAccept(pool).AcceptSingleTransaction(tx, args); if (!res) { // Remove coins that were not present in the coins cache before calling @@ -783,11 +778,9 @@ bool AcceptToMemoryPool(const Config &config, CTxMemPool &pool, TxValidationState &state, const CTransactionRef &tx, - bool bypass_limits, const Amount nAbsurdFee, - bool test_accept, Amount *fee_out) { + bool bypass_limits, bool test_accept, Amount *fee_out) { return AcceptToMemoryPoolWithTime(config, pool, state, tx, GetTime(), - bypass_limits, nAbsurdFee, test_accept, - fee_out); + bypass_limits, test_accept, fee_out); } CTransactionRef GetTransaction(const CBlockIndex *const block_index, @@ -5859,9 +5852,9 @@ TxValidationState state; if (nTime + nExpiryTimeout > nNow) { LOCK(cs_main); - AcceptToMemoryPoolWithTime( - config, pool, state, tx, nTime, false /* bypass_limits */, - Amount::zero() /* nAbsurdFee */, false /* test_accept */); + AcceptToMemoryPoolWithTime(config, pool, state, tx, nTime, + false /* bypass_limits */, + false /* test_accept */); if (state.IsValid()) { ++count; } else {