@@ -1261,37 +1261,9 @@ PeerManagerImpl::PeerManagerImpl(const CChainParams& chainparams, CConnman& conn
12611261 */
12621262void PeerManagerImpl::BlockConnected (const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindex)
12631263{
1264- {
1265- LOCK (g_cs_orphans);
1266-
1267- std::vector<uint256> vOrphanErase;
1268-
1269- for (const CTransactionRef& ptx : pblock->vtx ) {
1270- const CTransaction& tx = *ptx;
1264+ EraseOrphansForBlock (*pblock);
1265+ m_last_tip_update = GetTime ();
12711266
1272- // Which orphan pool entries must we evict?
1273- for (const auto & txin : tx.vin ) {
1274- auto itByPrev = mapOrphanTransactionsByPrev.find (txin.prevout );
1275- if (itByPrev == mapOrphanTransactionsByPrev.end ()) continue ;
1276- for (auto mi = itByPrev->second .begin (); mi != itByPrev->second .end (); ++mi) {
1277- const CTransaction& orphanTx = *(*mi)->second .tx ;
1278- const uint256& orphanHash = orphanTx.GetHash ();
1279- vOrphanErase.push_back (orphanHash);
1280- }
1281- }
1282- }
1283-
1284- // Erase orphan transactions included or precluded by this block
1285- if (vOrphanErase.size ()) {
1286- int nErased = 0 ;
1287- for (const uint256& orphanHash : vOrphanErase) {
1288- nErased += EraseOrphanTx (orphanHash);
1289- }
1290- LogPrint (BCLog::MEMPOOL, " Erased %d orphan tx included or conflicted by block\n " , nErased);
1291- }
1292-
1293- m_last_tip_update = GetTime ();
1294- }
12951267 {
12961268 LOCK (m_recent_confirmed_transactions_mutex);
12971269 for (const auto & ptx : pblock->vtx ) {
0 commit comments