Skip to content

Commit 123f5de

Browse files
committed
Remove calls to global Params() in tx_pool test
1 parent 9360778 commit 123f5de

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/test/fuzz/tx_pool.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void Finish(FuzzedDataProvider& fuzzed_data_provider, MockedTxPool& tx_pool, CCh
8686
BlockAssembler::Options options;
8787
options.nBlockMaxWeight = fuzzed_data_provider.ConsumeIntegralInRange(0U, MAX_BLOCK_WEIGHT);
8888
options.blockMinFeeRate = CFeeRate{ConsumeMoney(fuzzed_data_provider, /*max=*/COIN)};
89-
auto assembler = BlockAssembler{chainstate, *static_cast<CTxMemPool*>(&tx_pool), ::Params(), options};
89+
auto assembler = BlockAssembler{chainstate, *static_cast<CTxMemPool*>(&tx_pool), chainstate.m_params, options};
9090
auto block_template = assembler.CreateNewBlock(CScript{} << OP_TRUE);
9191
Assert(block_template->block.vtx.size() >= 1);
9292
}
@@ -224,13 +224,12 @@ FUZZ_TARGET_INIT(tx_pool_standard, initialize_tx_pool)
224224
// Make sure ProcessNewPackage on one transaction works and always fully validates the transaction.
225225
// The result is not guaranteed to be the same as what is returned by ATMP.
226226
const auto result_package = WITH_LOCK(::cs_main,
227-
return ProcessNewPackage(node.chainman->ActiveChainstate(), tx_pool, {tx}, true));
227+
return ProcessNewPackage(chainstate, tx_pool, {tx}, true));
228228
auto it = result_package.m_tx_results.find(tx->GetWitnessHash());
229229
Assert(it != result_package.m_tx_results.end());
230230
Assert(it->second.m_result_type == MempoolAcceptResult::ResultType::VALID ||
231231
it->second.m_result_type == MempoolAcceptResult::ResultType::INVALID);
232232

233-
CChainState& chainstate{node.chainman->ActiveChainstate()};
234233
const auto res = WITH_LOCK(::cs_main, return AcceptToMemoryPool(tx_pool, chainstate, tx, GetTime(), bypass_limits, /* test_accept= */ false));
235234
const bool accepted = res.m_result_type == MempoolAcceptResult::ResultType::VALID;
236235
SyncWithValidationInterfaceQueue();

0 commit comments

Comments
 (0)