diff --git a/src/net_processing.cpp b/src/net_processing.cpp --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -2736,8 +2736,9 @@ CTransactionRef ptx; vRecv >> ptx; const CTransaction &tx = *ptx; + const TxId &txid = tx.GetId(); - CInv inv(MSG_TX, tx.GetId()); + CInv inv(MSG_TX, txid); pfrom->AddInventoryKnown(inv); LOCK2(cs_main, g_cs_orphans); @@ -2745,7 +2746,6 @@ bool fMissingInputs = false; CValidationState state; - const TxId txid(inv.hash); CNodeState *nodestate = State(pfrom->GetId()); nodestate->m_tx_download.m_tx_announced.erase(txid); nodestate->m_tx_download.m_tx_in_flight.erase(txid);