Changeset View
Changeset View
Standalone View
Standalone View
src/net.h
Show First 20 Lines • Show All 1,012 Lines • ▼ Show 20 Lines | void PushAddress(const CAddress &_addr, FastRandomContext &insecure_rand) { | ||||
vAddrToSend[insecure_rand.randrange(vAddrToSend.size())] = | vAddrToSend[insecure_rand.randrange(vAddrToSend.size())] = | ||||
_addr; | _addr; | ||||
} else { | } else { | ||||
vAddrToSend.push_back(_addr); | vAddrToSend.push_back(_addr); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
void AddInventoryKnown(const CInv &inv) { | void AddKnownTx(const TxId &txid) { | ||||
if (m_tx_relay != nullptr) { | if (m_tx_relay != nullptr) { | ||||
LOCK(m_tx_relay->cs_tx_inventory); | LOCK(m_tx_relay->cs_tx_inventory); | ||||
m_tx_relay->filterInventoryKnown.insert(inv.hash); | m_tx_relay->filterInventoryKnown.insert(txid); | ||||
} | } | ||||
} | } | ||||
void PushInventory(const CInv &inv) { | void PushInventory(const CInv &inv) { | ||||
if (inv.type == MSG_TX && m_tx_relay != nullptr) { | if (inv.type == MSG_TX && m_tx_relay != nullptr) { | ||||
const TxId txid(inv.hash); | const TxId txid(inv.hash); | ||||
LOCK(m_tx_relay->cs_tx_inventory); | LOCK(m_tx_relay->cs_tx_inventory); | ||||
if (!m_tx_relay->filterInventoryKnown.contains(txid)) { | if (!m_tx_relay->filterInventoryKnown.contains(txid)) { | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |