You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
4dd94ca [refactor] remove access to mapTx in validation_block_tests (TheCharlatan)
d0cd2e8 [refactor] rewrite BlockAssembler inBlock and failedTx as sets of txids (glozow)
55b0939 scripted-diff: rename vTxHashes to txns_randomized (TheCharlatan)
a03aef9 [refactor] rewrite vTxHashes as a vector of CTransactionRef (glozow)
938643c [refactor] remove access to mapTx in validation.cpp (glozow)
333367a [txmempool] make CTxMemPoolEntry::lockPoints mutable (glozow)
1bf4855 [refactor] use CheckPackageLimits for checkChainLimits (glozow)
dbc5bdb [refactor] remove access to mapTx.find in mempool_tests.cpp (glozow)
f80909e [refactor] remove access to mapTx in blockencodings_tests.cpp (glozow)
8892d6b [refactor] remove access to mapTx from rpc/mempool.cpp (glozow)
fad61aa [refactor] get wtxid from entry instead of vTxHashes (glozow)
9cd8caf [refactor] use exists() instead of mapTx.find() (glozow)
1480469 [refactor] remove access to mapTx from policy/rbf.cpp (glozow)
1c6a73a [refactor] Add helper for retrieving mempool entry (TheCharlatan)
453b481 [refactor] Add helper for iterating through mempool entries (stickies-v)
Pull request description:
Motivation
* It seems preferable to use stdlib data structures instead of boost if they can achieve close to the same thing.
* Code external to mempool should ideally use its public helper methods instead of accessing `mapTx` or its iterators directly.
* Reduce the number of complex boost multi index type interactions
* Also see #28335 for further context/motivation. This PR together with #28385 simplifies that one.
Overview of things done in this PR:
* Make `vTxHashes` a vector of transaction references instead of a pair of transaction hash and iterator. The trade off here is that the data is retrieved on the fly with `GetEntry` instead of being cached in `vTxHashes`.
* Introduce `GetEntry` helper method to replace the more involved `GetIter` where applicable
* Replace `mapTx` access with `CTxMemPool` helper methods
* Simplify `checkChainLimits` call in `node/interfaces.cpp`
* Make `CTxMemPoolEntry`s `lockPoints`mutable such that they can be changed with a const iterator directly instead of going through `mapTx`
* Make `BlockAssembler`'s `inBlock` and `failedTx` sets of transaction hashes.
ACKs for top commit:
glozow:
reACK 4dd94ca
maflcko:
re-ACK 4dd94ca 👝
stickies-v:
re-ACK 4dd94ca
Tree-SHA512: c4d043f2186e4fde337591883fac66cade3058173987b49502bd65cecf69207a3df1077f6626809652ab63230013167b7f39a2b39f1c5166959e5495df57065f
BOOST_CHECK_EQUAL(pool.mapTx.find(block.vtx[2]->GetHash())->GetSharedTx().use_count(), SHARED_TX_OFFSET + 3); // +2 because of partialBlock and block2 and block3
199
+
BOOST_CHECK_EQUAL(pool.get(block.vtx[2]->GetHash()).use_count(), SHARED_TX_OFFSET + 3); // +2 because of partialBlock and block2 and block3
200
200
201
201
txhash = block.vtx[2]->GetHash();
202
202
block.vtx.clear();
203
203
block2.vtx.clear();
204
204
block3.vtx.clear();
205
-
BOOST_CHECK_EQUAL(pool.mapTx.find(txhash)->GetSharedTx().use_count(), SHARED_TX_OFFSET + 1 - 1); // + 1 because of partialBlock; -1 because of block.
205
+
BOOST_CHECK_EQUAL(pool.get(txhash).use_count(), SHARED_TX_OFFSET + 1 - 1); // + 1 because of partialBlock; -1 because of block.
206
206
}
207
-
BOOST_CHECK_EQUAL(pool.mapTx.find(txhash)->GetSharedTx().use_count(), SHARED_TX_OFFSET - 1); // -1 because of block
207
+
BOOST_CHECK_EQUAL(pool.get(txhash).use_count(), SHARED_TX_OFFSET - 1); // -1 because of block
0 commit comments