@@ -2593,7 +2593,7 @@ void ProcessMessage(
2593
2593
best_block = &inv.hash ;
2594
2594
}
2595
2595
} else {
2596
- pfrom.AddInventoryKnown (inv);
2596
+ pfrom.AddInventoryKnown (inv. hash );
2597
2597
if (fBlocksOnly ) {
2598
2598
LogPrint (BCLog::NET, " transaction (%s) inv sent in violation of protocol, disconnecting peer=%d\n " , inv.hash .ToString (), pfrom.GetId ());
2599
2599
pfrom.fDisconnect = true ;
@@ -2832,26 +2832,26 @@ void ProcessMessage(
2832
2832
vRecv >> ptx;
2833
2833
const CTransaction& tx = *ptx;
2834
2834
2835
- CInv inv (MSG_TX, tx. GetHash () );
2836
- pfrom.AddInventoryKnown (inv );
2835
+ const uint256& txid = ptx-> GetHash ();
2836
+ pfrom.AddInventoryKnown (txid );
2837
2837
2838
2838
LOCK2 (cs_main, g_cs_orphans);
2839
2839
2840
2840
TxValidationState state;
2841
2841
2842
2842
CNodeState* nodestate = State (pfrom.GetId ());
2843
- nodestate->m_tx_download .m_tx_announced .erase (inv. hash );
2844
- nodestate->m_tx_download .m_tx_in_flight .erase (inv. hash );
2845
- EraseTxRequest (inv. hash );
2843
+ nodestate->m_tx_download .m_tx_announced .erase (txid );
2844
+ nodestate->m_tx_download .m_tx_in_flight .erase (txid );
2845
+ EraseTxRequest (txid );
2846
2846
2847
2847
std::list<CTransactionRef> lRemovedTxn;
2848
2848
2849
- if (!AlreadyHave (inv , mempool) &&
2849
+ if (!AlreadyHave (CInv (MSG_TX, txid) , mempool) &&
2850
2850
AcceptToMemoryPool (mempool, state, ptx, &lRemovedTxn, false /* bypass_limits */ , 0 /* nAbsurdFee */ )) {
2851
2851
mempool.check (&::ChainstateActive ().CoinsTip ());
2852
2852
RelayTransaction (tx.GetHash (), connman);
2853
2853
for (unsigned int i = 0 ; i < tx.vout .size (); i++) {
2854
- auto it_by_prev = mapOrphanTransactionsByPrev.find (COutPoint (inv. hash , i));
2854
+ auto it_by_prev = mapOrphanTransactionsByPrev.find (COutPoint (txid , i));
2855
2855
if (it_by_prev != mapOrphanTransactionsByPrev.end ()) {
2856
2856
for (const auto & elem : it_by_prev->second ) {
2857
2857
pfrom.orphan_work_set .insert (elem->first );
@@ -2884,7 +2884,7 @@ void ProcessMessage(
2884
2884
2885
2885
for (const CTxIn& txin : tx.vin ) {
2886
2886
CInv _inv (MSG_TX | nFetchFlags, txin.prevout .hash );
2887
- pfrom.AddInventoryKnown (_inv );
2887
+ pfrom.AddInventoryKnown (txin. prevout . hash );
2888
2888
if (!AlreadyHave (_inv, mempool)) RequestTx (State (pfrom.GetId ()), _inv.hash , current_time);
2889
2889
}
2890
2890
AddOrphanTx (ptx, pfrom.GetId ());
0 commit comments