Changeset View
Changeset View
Standalone View
Standalone View
src/net.h
Show First 20 Lines • Show All 1,119 Lines • ▼ Show 20 Lines | public: | ||||
void AddKnownTx(const TxId &txid) { | 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(txid); | m_tx_relay->filterInventoryKnown.insert(txid); | ||||
} | } | ||||
} | } | ||||
void PushInventory(const CInv &inv) { | void PushTxInventory(const TxId &txid) { | ||||
if (inv.type == MSG_TX && m_tx_relay != nullptr) { | if (m_tx_relay == nullptr) { | ||||
const TxId txid(inv.hash); | return; | ||||
} | |||||
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)) { | ||||
m_tx_relay->setInventoryTxToSend.insert(txid); | m_tx_relay->setInventoryTxToSend.insert(txid); | ||||
} | } | ||||
} else if (inv.type == MSG_BLOCK) { | |||||
const BlockHash hash(inv.hash); | |||||
LOCK(cs_inventory); | |||||
vInventoryBlockToSend.push_back(hash); | |||||
} | } | ||||
void PushBlockInventory(const BlockHash &blockhash) { | |||||
LOCK(cs_inventory); | |||||
vInventoryBlockToSend.push_back(blockhash); | |||||
} | } | ||||
void PushBlockHash(const BlockHash &hash) { | void PushBlockHash(const BlockHash &hash) { | ||||
LOCK(cs_inventory); | LOCK(cs_inventory); | ||||
vBlockHashesToAnnounce.push_back(hash); | vBlockHashesToAnnounce.push_back(hash); | ||||
} | } | ||||
void CloseSocketDisconnect(); | void CloseSocketDisconnect(); | ||||
Show All 28 Lines |