@@ -1305,10 +1305,10 @@ bool static AlreadyHave(const CInv& inv) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
1305
1305
return true ;
1306
1306
}
1307
1307
1308
- static void RelayTransaction (const CTransaction& tx, CConnman* connman)
1308
+ void RelayTransaction (const uint256& txid, const CConnman& connman)
1309
1309
{
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)
1312
1312
{
1313
1313
pnode->PushInventory (inv);
1314
1314
});
@@ -1811,7 +1811,7 @@ void static ProcessOrphanTx(CConnman* connman, std::set<uint256>& orphan_work_se
1811
1811
if (setMisbehaving.count (fromPeer)) continue ;
1812
1812
if (AcceptToMemoryPool (mempool, orphan_state, porphanTx, &fMissingInputs2 , &removed_txn, false /* bypass_limits */ , 0 /* nAbsurdFee */ )) {
1813
1813
LogPrint (BCLog::MEMPOOL, " accepted orphan tx %s\n " , orphanHash.ToString ());
1814
- RelayTransaction (orphanTx, connman);
1814
+ RelayTransaction (orphanHash, * connman);
1815
1815
for (unsigned int i = 0 ; i < orphanTx.vout .size (); i++) {
1816
1816
auto it_by_prev = mapOrphanTransactionsByPrev.find (COutPoint (orphanHash, i));
1817
1817
if (it_by_prev != mapOrphanTransactionsByPrev.end ()) {
@@ -2498,7 +2498,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
2498
2498
if (!AlreadyHave (inv) &&
2499
2499
AcceptToMemoryPool (mempool, state, ptx, &fMissingInputs , &lRemovedTxn, false /* bypass_limits */ , 0 /* nAbsurdFee */ )) {
2500
2500
mempool.check (pcoinsTip.get ());
2501
- RelayTransaction (tx, connman);
2501
+ RelayTransaction (tx. GetHash (), * connman);
2502
2502
for (unsigned int i = 0 ; i < tx.vout .size (); i++) {
2503
2503
auto it_by_prev = mapOrphanTransactionsByPrev.find (COutPoint (inv.hash , i));
2504
2504
if (it_by_prev != mapOrphanTransactionsByPrev.end ()) {
@@ -2577,7 +2577,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
2577
2577
LogPrintf (" Not relaying invalid transaction %s from whitelisted peer=%d (%s)\n " , tx.GetHash ().ToString (), pfrom->GetId (), FormatStateMessage (state));
2578
2578
} else {
2579
2579
LogPrintf (" Force relaying tx %s from whitelisted peer=%d\n " , tx.GetHash ().ToString (), pfrom->GetId ());
2580
- RelayTransaction (tx, connman);
2580
+ RelayTransaction (tx. GetHash (), * connman);
2581
2581
}
2582
2582
}
2583
2583
}
0 commit comments