@@ -2121,14 +2121,7 @@ void PeerManagerImpl::ProcessOrphanTx(std::set<uint256>& orphan_work_set)
2121
2121
if (result.m_result_type == MempoolAcceptResult::ResultType::VALID) {
2122
2122
LogPrint (BCLog::MEMPOOL, " accepted orphan tx %s\n " , orphanHash.ToString ());
2123
2123
RelayTransaction (orphanHash, porphanTx->GetWitnessHash (), m_connman);
2124
- for (unsigned int i = 0 ; i < porphanTx->vout .size (); i++) {
2125
- auto it_by_prev = mapOrphanTransactionsByPrev.find (COutPoint (orphanHash, i));
2126
- if (it_by_prev != mapOrphanTransactionsByPrev.end ()) {
2127
- for (const auto & elem : it_by_prev->second ) {
2128
- orphan_work_set.insert (elem->first );
2129
- }
2130
- }
2131
- }
2124
+ AddChildrenToWorkSet (*porphanTx, orphan_work_set);
2132
2125
EraseOrphanTx (orphanHash);
2133
2126
for (const CTransactionRef& removedTx : result.m_replaced_transactions .value ()) {
2134
2127
AddToCompactExtraTransactions (removedTx);
@@ -3147,14 +3140,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
3147
3140
m_txrequest.ForgetTxHash (tx.GetHash ());
3148
3141
m_txrequest.ForgetTxHash (tx.GetWitnessHash ());
3149
3142
RelayTransaction (tx.GetHash (), tx.GetWitnessHash (), m_connman);
3150
- for (unsigned int i = 0 ; i < tx.vout .size (); i++) {
3151
- auto it_by_prev = mapOrphanTransactionsByPrev.find (COutPoint (txid, i));
3152
- if (it_by_prev != mapOrphanTransactionsByPrev.end ()) {
3153
- for (const auto & elem : it_by_prev->second ) {
3154
- peer->m_orphan_work_set .insert (elem->first );
3155
- }
3156
- }
3157
- }
3143
+ AddChildrenToWorkSet (tx, peer->m_orphan_work_set );
3158
3144
3159
3145
pfrom.nLastTXTime = GetTime ();
3160
3146
0 commit comments