@@ -1305,10 +1305,10 @@ bool static AlreadyHave(const CInv& inv) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
13051305 return true ;
13061306}
13071307
1308- static void RelayTransaction (const CTransaction& tx, CConnman* connman)
1308+ void RelayTransaction (const uint256& txid, const CConnman& connman)
13091309{
1310- CInv inv (MSG_TX, tx. GetHash () );
1311- connman-> ForEachNode ([&inv](CNode* pnode)
1310+ CInv inv (MSG_TX, txid );
1311+ connman. ForEachNode ([&inv](CNode* pnode)
13121312 {
13131313 pnode->PushInventory (inv);
13141314 });
@@ -1811,7 +1811,7 @@ void static ProcessOrphanTx(CConnman* connman, std::set<uint256>& orphan_work_se
18111811 if (setMisbehaving.count (fromPeer)) continue ;
18121812 if (AcceptToMemoryPool (mempool, orphan_state, porphanTx, &fMissingInputs2 , &removed_txn, false /* bypass_limits */ , 0 /* nAbsurdFee */ )) {
18131813 LogPrint (BCLog::MEMPOOL, " accepted orphan tx %s\n " , orphanHash.ToString ());
1814- RelayTransaction (orphanTx, connman);
1814+ RelayTransaction (orphanHash, * connman);
18151815 for (unsigned int i = 0 ; i < orphanTx.vout .size (); i++) {
18161816 auto it_by_prev = mapOrphanTransactionsByPrev.find (COutPoint (orphanHash, i));
18171817 if (it_by_prev != mapOrphanTransactionsByPrev.end ()) {
@@ -2498,7 +2498,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
24982498 if (!AlreadyHave (inv) &&
24992499 AcceptToMemoryPool (mempool, state, ptx, &fMissingInputs , &lRemovedTxn, false /* bypass_limits */ , 0 /* nAbsurdFee */ )) {
25002500 mempool.check (pcoinsTip.get ());
2501- RelayTransaction (tx, connman);
2501+ RelayTransaction (tx. GetHash (), * connman);
25022502 for (unsigned int i = 0 ; i < tx.vout .size (); i++) {
25032503 auto it_by_prev = mapOrphanTransactionsByPrev.find (COutPoint (inv.hash , i));
25042504 if (it_by_prev != mapOrphanTransactionsByPrev.end ()) {
@@ -2577,7 +2577,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
25772577 LogPrintf (" Not relaying invalid transaction %s from whitelisted peer=%d (%s)\n " , tx.GetHash ().ToString (), pfrom->GetId (), FormatStateMessage (state));
25782578 } else {
25792579 LogPrintf (" Force relaying tx %s from whitelisted peer=%d\n " , tx.GetHash ().ToString (), pfrom->GetId ());
2580- RelayTransaction (tx, connman);
2580+ RelayTransaction (tx. GetHash (), * connman);
25812581 }
25822582 }
25832583 }
0 commit comments