Changeset View
Changeset View
Standalone View
Standalone View
src/net.h
Show First 20 Lines • Show All 871 Lines • ▼ Show 20 Lines | struct TxRelay { | ||||
// They are sorted by the mempool before relay, so the order is not | // They are sorted by the mempool before relay, so the order is not | ||||
// important. | // important. | ||||
std::set<TxId> setInventoryTxToSend; | std::set<TxId> setInventoryTxToSend; | ||||
// Used for BIP35 mempool sending | // Used for BIP35 mempool sending | ||||
bool fSendMempool GUARDED_BY(cs_tx_inventory){false}; | bool fSendMempool GUARDED_BY(cs_tx_inventory){false}; | ||||
// Last time a "MEMPOOL" request was serviced. | // Last time a "MEMPOOL" request was serviced. | ||||
std::atomic<std::chrono::seconds> m_last_mempool_req{ | std::atomic<std::chrono::seconds> m_last_mempool_req{ | ||||
std::chrono::seconds{0}}; | std::chrono::seconds{0}}; | ||||
int64_t nNextInvSend{0}; | std::chrono::microseconds nNextInvSend{0}; | ||||
RecursiveMutex cs_feeFilter; | RecursiveMutex cs_feeFilter; | ||||
// Minimum fee rate with which to filter inv's to this node | // Minimum fee rate with which to filter inv's to this node | ||||
Amount minFeeFilter GUARDED_BY(cs_feeFilter){Amount::zero()}; | Amount minFeeFilter GUARDED_BY(cs_feeFilter){Amount::zero()}; | ||||
Amount lastSentFeeFilter{Amount::zero()}; | Amount lastSentFeeFilter{Amount::zero()}; | ||||
int64_t nextSendTimeFeeFilter{0}; | int64_t nextSendTimeFeeFilter{0}; | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 153 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
/** | /** | ||||
* Return a timestamp in the future (in microseconds) for exponentially | * Return a timestamp in the future (in microseconds) for exponentially | ||||
* distributed events. | * distributed events. | ||||
*/ | */ | ||||
int64_t PoissonNextSend(int64_t now, int average_interval_seconds); | int64_t PoissonNextSend(int64_t now, int average_interval_seconds); | ||||
/** Wrapper to return mockable type */ | |||||
inline std::chrono::microseconds | |||||
PoissonNextSend(std::chrono::microseconds now, | |||||
std::chrono::seconds average_interval) { | |||||
return std::chrono::microseconds{ | |||||
PoissonNextSend(now.count(), average_interval.count())}; | |||||
} | |||||
std::string getSubVersionEB(uint64_t MaxBlockSize); | std::string getSubVersionEB(uint64_t MaxBlockSize); | ||||
std::string userAgent(const Config &config); | std::string userAgent(const Config &config); | ||||
#endif // BITCOIN_NET_H | #endif // BITCOIN_NET_H |