Skip to content

Commit 4dd94ca

Browse files
committed
[refactor] remove access to mapTx in validation_block_tests
Use the helper function instead of reaching into the mapTx member object.
1 parent d0cd2e8 commit 4dd94ca

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/test/validation_block_tests.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,7 @@ BOOST_AUTO_TEST_CASE(mempool_locks_reorg)
283283

284284
// Check that all txs are in the pool
285285
{
286-
LOCK(m_node.mempool->cs);
287-
BOOST_CHECK_EQUAL(m_node.mempool->mapTx.size(), txs.size());
286+
BOOST_CHECK_EQUAL(m_node.mempool->size(), txs.size());
288287
}
289288

290289
// Run a thread that simulates an RPC caller that is polling while
@@ -295,7 +294,7 @@ BOOST_AUTO_TEST_CASE(mempool_locks_reorg)
295294
// not some intermediate amount.
296295
while (true) {
297296
LOCK(m_node.mempool->cs);
298-
if (m_node.mempool->mapTx.size() == 0) {
297+
if (m_node.mempool->size() == 0) {
299298
// We are done with the reorg
300299
break;
301300
}
@@ -304,7 +303,7 @@ BOOST_AUTO_TEST_CASE(mempool_locks_reorg)
304303
// be atomic. So the caller assumes that the returned mempool
305304
// is consistent. That is, it has all txs that were there
306305
// before the reorg.
307-
assert(m_node.mempool->mapTx.size() == txs.size());
306+
assert(m_node.mempool->size() == txs.size());
308307
continue;
309308
}
310309
LOCK(cs_main);

0 commit comments

Comments
 (0)