Line data Source code
1 : // Copyright (c) 2022 The Bitcoin Core developers 2 : // Distributed under the MIT software license, see the accompanying 3 : // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 : 5 : #include <test/util/txmempool.h> 6 : 7 : #include <chainparams.h> 8 : #include <node/context.h> 9 : #include <txmempool.h> 10 : #include <util/check.h> 11 : #include <util/time.h> 12 : #include <util/translation.h> 13 : 14 : /* TODO belongs to bitcoin/bitcoin#25290; uncomment when done 15 : CTxMemPool::Options MemPoolOptionsForTest(const NodeContext& node) 16 : { 17 : CTxMemPool::Options mempool_opts{ 18 : .estimator = node.fee_estimator.get(), 19 : // Default to always checking mempool regardless of 20 : // chainparams.DefaultConsistencyChecks for tests 21 : .check_ratio = 1, 22 : }; 23 : const auto result{ApplyArgsManOptions(*node.args, ::Params(), mempool_opts)}; 24 : Assert(result); 25 : return mempool_opts; 26 : } 27 : */ 28 : 29 26810 : CTxMemPoolEntry TestMemPoolEntryHelper::FromTx(const CMutableTransaction& tx) const 30 : { 31 26810 : return FromTx(MakeTransactionRef(tx)); 32 0 : } 33 : 34 26827 : CTxMemPoolEntry TestMemPoolEntryHelper::FromTx(const CTransactionRef& tx) const 35 : { 36 53654 : return CTxMemPoolEntry(tx, nFee, TicksSinceEpoch<std::chrono::seconds>(time), nHeight, 37 26827 : spendsCoinbase, sigOpCount, lp); 38 : }