0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-13 11:25:02 -05:00

[refactor] remove access to mapTx in validation_block_tests

Use the helper function instead of reaching into the mapTx member
object.
This commit is contained in:
TheCharlatan 2023-11-01 20:21:43 +01:00
parent d0cd2e804e
commit 4dd94ca18f
No known key found for this signature in database
GPG key ID: 9B79B45691DB4173

View file

@ -283,8 +283,7 @@ BOOST_AUTO_TEST_CASE(mempool_locks_reorg)
// Check that all txs are in the pool // Check that all txs are in the pool
{ {
LOCK(m_node.mempool->cs); BOOST_CHECK_EQUAL(m_node.mempool->size(), txs.size());
BOOST_CHECK_EQUAL(m_node.mempool->mapTx.size(), txs.size());
} }
// Run a thread that simulates an RPC caller that is polling while // Run a thread that simulates an RPC caller that is polling while
@ -295,7 +294,7 @@ BOOST_AUTO_TEST_CASE(mempool_locks_reorg)
// not some intermediate amount. // not some intermediate amount.
while (true) { while (true) {
LOCK(m_node.mempool->cs); LOCK(m_node.mempool->cs);
if (m_node.mempool->mapTx.size() == 0) { if (m_node.mempool->size() == 0) {
// We are done with the reorg // We are done with the reorg
break; break;
} }
@ -304,7 +303,7 @@ BOOST_AUTO_TEST_CASE(mempool_locks_reorg)
// be atomic. So the caller assumes that the returned mempool // be atomic. So the caller assumes that the returned mempool
// is consistent. That is, it has all txs that were there // is consistent. That is, it has all txs that were there
// before the reorg. // before the reorg.
assert(m_node.mempool->mapTx.size() == txs.size()); assert(m_node.mempool->size() == txs.size());
continue; continue;
} }
LOCK(cs_main); LOCK(cs_main);