@@ -2212,7 +2212,17 @@ static int64_t nTimePostConnect = 0;
2212
2212
* part of a single ActivateBestChainStep call.
2213
2213
*/
2214
2214
struct ConnectTrace {
2215
+ private:
2215
2216
std::vector<std::pair<CBlockIndex*, std::shared_ptr<const CBlock> > > blocksConnected;
2217
+
2218
+ public:
2219
+ void BlockConnected (CBlockIndex* pindex, std::shared_ptr<const CBlock> pblock) {
2220
+ blocksConnected.emplace_back (pindex, std::move (pblock));
2221
+ }
2222
+
2223
+ std::vector<std::pair<CBlockIndex*, std::shared_ptr<const CBlock> > >& GetBlocksConnected () {
2224
+ return blocksConnected;
2225
+ }
2216
2226
};
2217
2227
2218
2228
/* *
@@ -2270,7 +2280,7 @@ bool static ConnectTip(CValidationState& state, const CChainParams& chainparams,
2270
2280
LogPrint (BCLog::BENCH, " - Connect postprocess: %.2fms [%.2fs]\n " , (nTime6 - nTime5) * 0.001 , nTimePostConnect * 0.000001 );
2271
2281
LogPrint (BCLog::BENCH, " - Connect block: %.2fms [%.2fs]\n " , (nTime6 - nTime1) * 0.001 , nTimeTotal * 0.000001 );
2272
2282
2273
- connectTrace.blocksConnected . emplace_back (pindexNew, std::move (pthisBlock));
2283
+ connectTrace.BlockConnected (pindexNew, std::move (pthisBlock));
2274
2284
return true ;
2275
2285
}
2276
2286
@@ -2499,7 +2509,7 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams,
2499
2509
} // MemPoolConflictRemovalTracker destroyed and conflict evictions are notified
2500
2510
2501
2511
// Transactions in the connected block are notified
2502
- for (const auto & pair : connectTrace.blocksConnected ) {
2512
+ for (const auto & pair : connectTrace.GetBlocksConnected () ) {
2503
2513
assert (pair.second );
2504
2514
const CBlock& block = *(pair.second );
2505
2515
for (unsigned int i = 0 ; i < block.vtx .size (); i++)
0 commit comments