Changeset View
Changeset View
Standalone View
Standalone View
src/net.h
Show First 20 Lines • Show All 953 Lines • ▼ Show 20 Lines | std::chrono::microseconds | ||||
m_next_local_addr_send GUARDED_BY(cs_sendProcessing){0}; | m_next_local_addr_send GUARDED_BY(cs_sendProcessing){0}; | ||||
bool IsAddrRelayPeer() const { return m_addr_known != nullptr; } | bool IsAddrRelayPeer() const { return m_addr_known != nullptr; } | ||||
// List of block ids we still have to announce. | // List of block ids we still have to announce. | ||||
// There is no final sorting before sending, as they are always sent | // There is no final sorting before sending, as they are always sent | ||||
// immediately and in the order requested. | // immediately and in the order requested. | ||||
std::vector<BlockHash> vInventoryBlockToSend GUARDED_BY(cs_inventory); | std::vector<BlockHash> vInventoryBlockToSend GUARDED_BY(cs_inventory); | ||||
RecursiveMutex cs_inventory; | Mutex cs_inventory; | ||||
struct TxRelay { | struct TxRelay { | ||||
mutable RecursiveMutex cs_filter; | mutable RecursiveMutex cs_filter; | ||||
// We use fRelayTxes for two purposes - | // We use fRelayTxes for two purposes - | ||||
// a) it allows us to not relay tx invs before receiving the peer's | // a) it allows us to not relay tx invs before receiving the peer's | ||||
// version message. | // version message. | ||||
// b) the peer may tell us in its version message that we should not | // b) the peer may tell us in its version message that we should not | ||||
// relay tx invs unless it loads a bloom filter. | // relay tx invs unless it loads a bloom filter. | ||||
▲ Show 20 Lines • Show All 185 Lines • ▼ Show 20 Lines | void PushTxInventory(const TxId &txid) { | ||||
return; | 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); | ||||
} | } | ||||
} | } | ||||
void PushBlockInventory(const BlockHash &blockhash) { | |||||
LOCK(cs_inventory); | |||||
vInventoryBlockToSend.push_back(blockhash); | |||||
} | |||||
void PushBlockHash(const BlockHash &hash) { | |||||
LOCK(cs_inventory); | |||||
vBlockHashesToAnnounce.push_back(hash); | |||||
} | |||||
void CloseSocketDisconnect(); | void CloseSocketDisconnect(); | ||||
void copyStats(CNodeStats &stats, const std::vector<bool> &m_asmap); | void copyStats(CNodeStats &stats, const std::vector<bool> &m_asmap); | ||||
ServiceFlags GetLocalServices() const { return nLocalServices; } | ServiceFlags GetLocalServices() const { return nLocalServices; } | ||||
std::string GetAddrName() const; | std::string GetAddrName() const; | ||||
//! Sets the addrName only if it was not previously set | //! Sets the addrName only if it was not previously set | ||||
Show All 21 Lines |