mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 07:39:08 +01:00
Rename AddInventoryKnown() to AddKnownTx()
This commit is contained in:
committed by
John Newbery
parent
879a3cf2c2
commit
e364b2a2d8
@@ -969,7 +969,7 @@ public:
|
||||
}
|
||||
|
||||
|
||||
void AddInventoryKnown(const uint256& hash)
|
||||
void AddKnownTx(const uint256& hash)
|
||||
{
|
||||
if (m_tx_relay != nullptr) {
|
||||
LOCK(m_tx_relay->cs_tx_inventory);
|
||||
|
||||
@@ -2368,7 +2368,7 @@ bool ProcessMessage(CNode* pfrom, const std::string& msg_type, CDataStream& vRec
|
||||
best_block = &inv.hash;
|
||||
}
|
||||
} else {
|
||||
pfrom->AddInventoryKnown(inv.hash);
|
||||
pfrom->AddKnownTx(inv.hash);
|
||||
if (fBlocksOnly) {
|
||||
LogPrint(BCLog::NET, "transaction (%s) inv sent in violation of protocol, disconnecting peer=%d\n", inv.hash.ToString(), pfrom->GetId());
|
||||
pfrom->fDisconnect = true;
|
||||
@@ -2615,14 +2615,14 @@ bool ProcessMessage(CNode* pfrom, const std::string& msg_type, CDataStream& vRec
|
||||
CNodeState* nodestate = State(pfrom->GetId());
|
||||
|
||||
const uint256& hash = nodestate->m_wtxid_relay ? wtxid : txid;
|
||||
pfrom->AddInventoryKnown(hash);
|
||||
pfrom->AddKnownTx(hash);
|
||||
if (nodestate->m_wtxid_relay && txid != wtxid) {
|
||||
// Insert txid into filterInventoryKnown, even for
|
||||
// wtxidrelay peers. This prevents re-adding of
|
||||
// unconfirmed parents to the recently_announced
|
||||
// filter, when a child tx is requested. See
|
||||
// ProcessGetData().
|
||||
pfrom->AddInventoryKnown(txid);
|
||||
pfrom->AddKnownTx(txid);
|
||||
}
|
||||
|
||||
TxValidationState state;
|
||||
@@ -2689,7 +2689,7 @@ bool ProcessMessage(CNode* pfrom, const std::string& msg_type, CDataStream& vRec
|
||||
// Eventually we should replace this with an improved
|
||||
// protocol for getting all unconfirmed parents.
|
||||
CInv _inv(MSG_TX | nFetchFlags, txin.prevout.hash);
|
||||
pfrom->AddInventoryKnown(txin.prevout.hash);
|
||||
pfrom->AddKnownTx(txin.prevout.hash);
|
||||
if (!AlreadyHave(_inv, mempool)) RequestTx(State(pfrom->GetId()), _inv.hash, current_time);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user