mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05:00
Remove calls to global Params() in tx_pool test
This commit is contained in:
parent
9360778d6e
commit
123f5de826
1 changed files with 2 additions and 3 deletions
|
@ -86,7 +86,7 @@ void Finish(FuzzedDataProvider& fuzzed_data_provider, MockedTxPool& tx_pool, CCh
|
||||||
BlockAssembler::Options options;
|
BlockAssembler::Options options;
|
||||||
options.nBlockMaxWeight = fuzzed_data_provider.ConsumeIntegralInRange(0U, MAX_BLOCK_WEIGHT);
|
options.nBlockMaxWeight = fuzzed_data_provider.ConsumeIntegralInRange(0U, MAX_BLOCK_WEIGHT);
|
||||||
options.blockMinFeeRate = CFeeRate{ConsumeMoney(fuzzed_data_provider, /*max=*/COIN)};
|
options.blockMinFeeRate = CFeeRate{ConsumeMoney(fuzzed_data_provider, /*max=*/COIN)};
|
||||||
auto assembler = BlockAssembler{chainstate, *static_cast<CTxMemPool*>(&tx_pool), ::Params(), options};
|
auto assembler = BlockAssembler{chainstate, *static_cast<CTxMemPool*>(&tx_pool), chainstate.m_params, options};
|
||||||
auto block_template = assembler.CreateNewBlock(CScript{} << OP_TRUE);
|
auto block_template = assembler.CreateNewBlock(CScript{} << OP_TRUE);
|
||||||
Assert(block_template->block.vtx.size() >= 1);
|
Assert(block_template->block.vtx.size() >= 1);
|
||||||
}
|
}
|
||||||
|
@ -224,13 +224,12 @@ FUZZ_TARGET_INIT(tx_pool_standard, initialize_tx_pool)
|
||||||
// Make sure ProcessNewPackage on one transaction works and always fully validates the transaction.
|
// Make sure ProcessNewPackage on one transaction works and always fully validates the transaction.
|
||||||
// The result is not guaranteed to be the same as what is returned by ATMP.
|
// The result is not guaranteed to be the same as what is returned by ATMP.
|
||||||
const auto result_package = WITH_LOCK(::cs_main,
|
const auto result_package = WITH_LOCK(::cs_main,
|
||||||
return ProcessNewPackage(node.chainman->ActiveChainstate(), tx_pool, {tx}, true));
|
return ProcessNewPackage(chainstate, tx_pool, {tx}, true));
|
||||||
auto it = result_package.m_tx_results.find(tx->GetWitnessHash());
|
auto it = result_package.m_tx_results.find(tx->GetWitnessHash());
|
||||||
Assert(it != result_package.m_tx_results.end());
|
Assert(it != result_package.m_tx_results.end());
|
||||||
Assert(it->second.m_result_type == MempoolAcceptResult::ResultType::VALID ||
|
Assert(it->second.m_result_type == MempoolAcceptResult::ResultType::VALID ||
|
||||||
it->second.m_result_type == MempoolAcceptResult::ResultType::INVALID);
|
it->second.m_result_type == MempoolAcceptResult::ResultType::INVALID);
|
||||||
|
|
||||||
CChainState& chainstate{node.chainman->ActiveChainstate()};
|
|
||||||
const auto res = WITH_LOCK(::cs_main, return AcceptToMemoryPool(tx_pool, chainstate, tx, GetTime(), bypass_limits, /* test_accept= */ false));
|
const auto res = WITH_LOCK(::cs_main, return AcceptToMemoryPool(tx_pool, chainstate, tx, GetTime(), bypass_limits, /* test_accept= */ false));
|
||||||
const bool accepted = res.m_result_type == MempoolAcceptResult::ResultType::VALID;
|
const bool accepted = res.m_result_type == MempoolAcceptResult::ResultType::VALID;
|
||||||
SyncWithValidationInterfaceQueue();
|
SyncWithValidationInterfaceQueue();
|
||||||
|
|
Loading…
Add table
Reference in a new issue