31 #include <condition_variable> 34 #include <arpa/inet.h> 107 std::vector<unsigned char>
data;
193 void OpenNetworkConnection(
const CAddress& addrConnect,
bool fCountFailure,
CSemaphoreGrant *grantOutbound =
nullptr,
const char *strDest =
nullptr,
bool fOneShot =
false,
bool fFeeler =
false,
bool manual_connection =
false);
200 template<
typename Callable>
204 for (
auto&& node : vNodes) {
210 template<
typename Callable>
214 for (
auto&& node : vNodes) {
220 template<
typename Callable,
typename CallableAfter>
224 for (
auto&& node : vNodes) {
231 template<
typename Callable,
typename CallableAfter>
235 for (
auto&& node : vNodes) {
262 bool AddNode(
const std::string& node);
325 bool InitBinds(
const std::vector<CService>& binds,
const std::vector<CService>& whiteBinds);
335 bool GenerateSelectSet(std::set<SOCKET> &recv_set, std::set<SOCKET> &send_set, std::set<SOCKET> &error_set);
336 void SocketEvents(std::set<SOCKET> &recv_set, std::set<SOCKET> &send_set, std::set<SOCKET> &error_set);
444 extern std::unique_ptr<CConnman>
g_connman;
445 extern std::unique_ptr<BanMan>
g_banman;
460 while (first != last) {
461 if (!(*first))
return false;
613 int readHeader(
const char *pch,
unsigned int nBytes);
614 int readData(
const char *pch,
unsigned int nBytes);
784 bool ReceiveMsgBytes(
const char *pch,
unsigned int nBytes,
bool& complete);
838 filterInventoryKnown.insert(inv.
hash);
846 if (!filterInventoryKnown.contains(inv.
hash)) {
850 vInventoryBlockToSend.push_back(inv.
hash);
857 vBlockHashesToAnnounce.push_back(hash);
881 #endif // BITCOIN_NET_H CCriticalSection cs_vAddedNodes
Definition: net.h:395
static const int MAX_OUTBOUND_CONNECTIONS
Definition: net.h:59
double dPingTime
Definition: net.h:559
bool m_manual_connection
Definition: net.h:552
std::atomic< int > nRefCount
Definition: net.h:680
bool m_prefer_evict
Definition: net.h:659
CSerializedNetMsg & operator=(CSerializedNetMsg &&)=default
std::unique_ptr< CConnman > g_connman
Definition: init.cpp:84
bool GetNetworkActive() const
Definition: net.h:190
uint64_t nSendBytes GUARDED_BY(cs_vSend)
Definition: net.h:628
Definition: protocol.h:325
void MarkAddressGood(const CAddress &addr)
Definition: net.cpp:2385
int GetMyStartingHeight() const
Definition: net.h:774
void ProcessOneShot()
Definition: net.cpp:1609
bool IsReachable(enum Network net)
Definition: net.cpp:250
void SetVersion(int n)
Definition: streams.h:396
const uint64_t nSeed0
Definition: net.h:418
static const unsigned int MAX_PROTOCOL_MESSAGE_LENGTH
Definition: net.h:55
CRollingBloomFilter addrKnown
Definition: net.h:696
int64_t nNextAddrSend GUARDED_BY(cs_sendProcessing)
Definition: net.h:699
unsigned int nSendBufferMaxSize
Definition: net.h:385
std::vector< CAddress > vAddrToSend
Definition: net.h:695
double dPingWait
Definition: net.h:560
~CConnman()
Definition: net.cpp:2369
ServiceFlags
Definition: protocol.h:247
bool fMsgProcWake
Definition: net.h:421
static const uint64_t MAX_UPLOAD_TIMEFRAME
Definition: net.h:75
void ThreadMessageHandler()
Definition: net.cpp:1945
std::atomic_bool fPauseSend
Definition: net.h:684
bool fFeeler
Definition: net.h:661
int64_t PoissonNextSendInbound(int64_t now, int average_interval_seconds)
Definition: net.cpp:2705
CHash256 hasher
Definition: net.h:576
int64_t m_peer_connect_timeout
Definition: net.h:139
bool GetUseAddrmanOutgoing() const
Definition: net.h:191
bool fListen
Definition: net.cpp:81
std::set< uint256 > orphan_work_set
Definition: net.h:742
CClientUIInterface * clientInterface
Definition: net.h:413
const CAddress addr
Definition: net.h:649
std::string addrName
Definition: net.h:548
CService resolvedAddress
Definition: net.h:90
std::vector< unsigned char > GetKey() const
Definition: netaddress.cpp:669
void PushMessage(CNode *pnode, CSerializedNetMsg &&msg)
Definition: net.cpp:2655
bool fConnected
Definition: net.h:91
const std::string NET_MESSAGE_COMMAND_OTHER
Definition: net.cpp:73
~CNode()
Definition: net.cpp:2645
std::map< CNetAddr, LocalServiceInfo > mapLocalHost GUARDED_BY(cs_mapLocalHost)
int64_t m_peer_connect_timeout
Definition: net.h:379
std::vector< CService > vBinds
Definition: net.h:142
static const bool DEFAULT_FORCEDNSSEED
Definition: net.h:81
bool SeenLocal(const CService &addr)
Definition: net.cpp:262
uint64_t GetMaxOutboundTarget()
Definition: net.cpp:2519
Mutex mutexMsgProc
Definition: net.h:424
uint64_t nMaxOutboundTimeframe
Definition: net.h:137
std::atomic< int64_t > nLastRecv
Definition: net.h:645
bool whitelisted
Definition: net.h:318
void StartMapPort()
Definition: net.cpp:1503
void StopMapPort()
Definition: net.cpp:1511
const bool fInbound
Definition: net.h:666
Definition: protocol.h:371
uint256 hash
Definition: protocol.h:404
int GetRefCount() const
Definition: net.h:778
Definition: scheduler.h:37
std::string addrLocal
Definition: net.h:564
std::thread threadSocketHandler
Definition: net.h:430
#define USE_UPNP
Definition: bitcoin-config.h:432
Definition: netaddress.h:32
bool g_relay_txes
Definition: net.cpp:82
void CloseSocketDisconnect()
Definition: net.cpp:447
int nMaxFeeler
Definition: net.h:410
~NetEventsInterface()=default
std::vector< ListenSocket > vhListenSocket
Definition: net.h:388
std::atomic_bool fPauseRecv
Definition: net.h:683
uint256 data_hash
Definition: net.h:577
const CAddress addrBind
Definition: net.h:651
static const bool DEFAULT_LISTEN
Definition: net.h:63
bool result_type
Definition: net.h:455
std::atomic< int > nStartingHeight
Definition: net.h:692
static const int MAX_ADDNODE_CONNECTIONS
Definition: net.h:61
bool IsValid() const
Definition: netaddress.cpp:247
bool ReceiveMsgBytes(const char *pch, unsigned int nBytes, bool &complete)
Definition: net.cpp:555
bool in_data
Definition: net.h:579
void DeleteNode(CNode *pnode)
Definition: net.cpp:2358
void AdvertiseLocal(CNode *pnode)
Definition: net.cpp:177
void DumpAddresses()
Definition: net.cpp:1598
int nMaxOutbound
Definition: net.h:408
CConnman(uint64_t seed0, uint64_t seed1)
Definition: net.cpp:2132
bool BindListenPort(const CService &bindAddr, std::string &strError, bool fWhitelisted=false)
Definition: net.cpp:1999
std::string command
Definition: net.h:108
bool InitBinds(const std::vector< CService > &binds, const std::vector< CService > &whiteBinds)
Definition: net.cpp:2159
bool fInbound
Definition: net.h:92
size_t GetAddressCount() const
Definition: net.cpp:2375
bool fRelayTxes GUARDED_BY(cs_filter)
Definition: net.h:675
CClientUIInterface * uiInterface
Definition: net.h:132
Definition: protocol.h:372
void AddNewAddresses(const std::vector< CAddress > &vAddr, const CAddress &addrFrom, int64_t nTimePenalty=0)
Definition: net.cpp:2390
static CScheduler scheduler
Definition: init.cpp:178
CAddress addrBind
Definition: net.h:568
const ServiceFlags nLocalServices
Definition: net.h:753
static const int FEELER_INTERVAL
Definition: net.h:47
void PushAddress(const CAddress &_addr, FastRandomContext &insecure_rand)
Definition: net.h:819
uint64_t GetLocalNonce() const
Definition: net.h:770
static const int TIMEOUT_INTERVAL
Definition: net.h:45
std::atomic< int64_t > m_next_send_inv_to_incoming
Definition: net.h:440
CCriticalSection cs_vOneShots
Definition: net.h:393
CSerializedNetMsg()=default
BanMan * m_banman
Definition: net.h:134
CCriticalSection cs_vSend
Definition: net.h:630
int readData(const char *pch, unsigned int nBytes)
Definition: net.cpp:664
std::atomic< int64_t > nPingUsecTime
Definition: net.h:731
void resize(size_type n, value_type c=0)
Definition: streams.h:296
void ThreadOpenAddedConnections()
Definition: net.cpp:1878
CNode(NodeId id, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn, SOCKET hSocketIn, const CAddress &addrIn, uint64_t nKeyedNetGroupIn, uint64_t nLocalHostNonceIn, const CAddress &addrBindIn, const std::string &addrNameIn="", bool fInboundIn=false)
Definition: net.cpp:2615
int GetBestHeight() const
Definition: net.cpp:2608
std::vector< CService > vWhiteBinds
Definition: net.h:142
bool fClient
Definition: net.h:664
CAmount lastSentFeeFilter
Definition: net.h:739
uint64_t GetTotalBytesRecv()
Definition: net.cpp:2586
unsigned int GetReceiveFloodSize() const
Definition: net.cpp:2613
void copyStats(CNodeStats &stats)
Definition: net.cpp:494
std::list< CNode * > vNodesDisconnected
Definition: net.h:397
Definition: threadinterrupt.h:20
mapMsgCmdSize mapRecvBytesPerMsgCmd
Definition: net.h:557
unsigned int nReceiveFloodSize
Definition: net.h:136
CService GetAddrLocal() const
Definition: net.cpp:478
std::atomic_bool fSuccessfullyConnected
Definition: net.h:667
const uint64_t nSeed1
Definition: net.h:418
int GetRecvVersion() const
Definition: net.h:790
static const unsigned int MAX_LOCATOR_SZ
Definition: net.h:51
size_t GetNodeCount(NumConnections num)
Definition: net.cpp:2423
std::vector< AddedNodeInfo > GetAddedNodeInfo()
Definition: net.cpp:1824
int64_t CAmount
Definition: amount.h:12
bool Bind(const CService &addr, unsigned int flags)
Definition: net.cpp:2146
void SetVersion(int nVersionIn)
Definition: net.h:607
int nMaxAddnode
Definition: net.h:409
uint64_t GetMaxOutboundTimeframe()
Definition: net.cpp:2525
std::deque< CInv > vRecvGetData
Definition: net.h:640
std::string cleanSubVer
Definition: net.h:550
CNode * ConnectNode(CAddress addrConnect, const char *pszDest, bool fCountFailure, bool manual_connection)
Definition: net.cpp:351
std::atomic< int64_t > nMinPingUsecTime
Definition: net.h:733
uint64_t CalculateKeyedNetGroup(const CAddress &ad) const
Definition: net.cpp:2726
static const size_t DEFAULT_MAXRECEIVEBUFFER
Definition: net.h:82
void Release()
Definition: net.h:807
NodeId GetId() const
Definition: net.h:766
uint64_t randrange(uint64_t range) noexcept
Definition: random.h:165
std::atomic< NodeId > nLastNodeId
Definition: net.h:399
uint64_t nTotalBytesRecv GUARDED_BY(cs_totalBytesRecv)
std::atomic< int > nRecvVersion
Definition: net.h:642
std::vector< unsigned char > data
Definition: net.h:107
int nMaxConnections
Definition: net.h:407
BanMan * m_banman
Definition: net.h:415
Definition: protocol.h:249
bool m_use_addrman_outgoing
Definition: net.h:411
void InterruptMapPort()
Definition: net.cpp:1507
bool RemoveAddedNode(const std::string &node)
Definition: net.cpp:2411
std::string GetAddrName() const
Definition: net.cpp:466
std::vector< CSubNet > vWhitelistedRange
Definition: net.h:141
void InactivityCheck(CNode *pnode)
Definition: net.cpp:1051
std::atomic_bool fDisconnect
Definition: net.h:670
bool GetLocal(CService &addr, const CNetAddr *paddrPeer=nullptr)
Definition: net.cpp:100
void SetRecvVersion(int nVersionIn)
Definition: net.h:786
std::atomic< int64_t > nPingUsecStart
Definition: net.h:729
static bool NodeFullyConnected(const CNode *pnode)
Definition: net.cpp:2650
bool CheckIncomingNonce(uint64_t nonce)
Definition: net.cpp:325
NumConnections
Definition: clientmodel.h:36
std::atomic< ServiceFlags > nServices
Definition: net.h:624
std::atomic< uint64_t > nPingNonceSent
Definition: net.h:727
uint64_t GetOutboundTargetBytesLeft()
Definition: net.cpp:2577
int64_t nTimeOffset
Definition: net.h:547
bool BindListenPort(const CService &bindAddr, std::string &strError, bool fWhitelisted=false)
CCriticalSection cs_vRecv
Definition: net.h:632
unsigned int nPrevNodeCount
Definition: net.h:400
CCriticalSection cs_addrLocal
Definition: net.h:763
const uint256 & GetMessageHash() const
Definition: net.cpp:681
void GetNodeStats(std::vector< CNodeStats > &vstats)
Definition: net.cpp:2439
std::atomic< bool > fNetworkActive
Definition: net.h:389
#define LOCK(cs)
Definition: sync.h:182
NumConnections
Definition: net.h:117
int nStartingHeight
Definition: net.h:553
int nMaxOutbound
Definition: net.h:128
void NotifyNumConnectionsChanged()
Definition: net.cpp:1037
void ForEachNodeThen(Callable &&pre, CallableAfter &&post) const
Definition: net.h:232
std::atomic_bool m_try_another_outbound_peer
Definition: net.h:438
bool IsPeerAddrLocalGood(CNode *pnode)
Definition: net.cpp:169
virtual void FinalizeNode(NodeId id, bool &update_connection_time)=0
void SetAddrLocal(const CService &addrLocalIn)
May not be called more than once.
Definition: net.cpp:483
static const int INIT_PROTO_VERSION
initial proto version, to be increased after version/verack negotiation
Definition: version.h:15
std::vector< CSubNet > vWhitelistedRange
Definition: net.h:383
unsigned long long uint64_t
Definition: stdint.h:22
bool fWhitelisted
Definition: net.h:558
void RecordBytesSent(uint64_t bytes)
Definition: net.cpp:2496
int nMaxAddnode
Definition: net.h:129
ListenSocket(SOCKET socket_, bool whitelisted_)
Definition: net.h:320
size_t nProcessQueueSize
Definition: net.h:636
CAddrMan addrman
Definition: net.h:391
void ForEachNode(Callable &&func) const
Definition: net.h:211
bool fSendMempool GUARDED_BY(cs_inventory)
Definition: net.h:716
bool fInbound
Definition: net.h:551
bool OutboundTargetReached(bool historicalBlockServingLimit)
Definition: net.cpp:2557
CAddress addr
Definition: net.h:566
SOCKET hSocket GUARDED_BY(cs_hSocket)
void PushInventory(const CInv &inv)
Definition: net.h:842
std::thread threadDNSAddressSeed
Definition: net.h:429
uint64_t nSendBytes
Definition: net.h:554
void SetBestHeight(int height)
Definition: net.cpp:2603
size_t nSendSize
Definition: net.h:626
std::vector< std::string > m_specified_outgoing
Definition: net.h:144
Network
Definition: netaddress.h:20
bool fRelayTxes
Definition: net.h:543
void AddAddressKnown(const CAddress &_addr)
Definition: net.h:814
bool fGetAddr
Definition: net.h:697
int64_t NodeId
Definition: net.h:85
static const unsigned int DEFAULT_MAX_PEER_CONNECTIONS
Definition: net.h:71
int nMaxFeeler
Definition: net.h:130
Definition: streams.h:203
CCriticalSection cs_hSocket
Definition: net.h:631
void SocketHandler()
Definition: net.cpp:1248
unsigned int nReceiveFloodSize
Definition: net.h:386
ServiceFlags GetLocalServices() const
Definition: net.h:864
void SetServices(const CService &addr, ServiceFlags nServices)
Definition: net.cpp:2380
std::unique_ptr< BanMan > g_banman
Definition: init.cpp:86
SOCKET socket
Definition: net.h:317
CCriticalSection cs_feeFilter
Definition: net.h:737
void ThreadOpenConnections(std::vector< std::string > connect)
Definition: net.cpp:1657
ServiceFlags nLocalServices
Definition: net.h:126
CNode & operator=(const CNode &)=delete
CDataStream hdrbuf
Definition: net.h:581
void Discover()
Definition: net.cpp:2068
const uint64_t nLocalHostNonce
Definition: net.h:751
std::atomic< bool > flagInterruptMsgProc
Definition: net.h:425
ServiceFlags nLocalServices
Definition: net.h:403
uint64_t nMaxOutboundLimit
Definition: net.h:138
unsigned int SOCKET
Definition: compat.h:48
void Init(const Options &connOptions)
Definition: net.h:148
CNode * AddRef()
Definition: net.h:801
std::set< uint256 > setKnown
Definition: net.h:698
friend struct CConnmanTest
Definition: net.h:442
CAmount minFeeFilter GUARDED_BY(cs_feeFilter)
Definition: net.h:737
CNetMessage(const CMessageHeader::MessageStartChars &pchMessageStartIn, int nTypeIn, int nVersionIn)
Definition: net.h:590
std::unique_ptr< CBloomFilter > pfilter PT_GUARDED_BY(cs_filter)
int flags
Definition: bitcoin-tx.cpp:507
CThreadInterrupt interruptNet
Definition: net.h:427
bool fWhitelisted
Definition: net.h:660
void SetTryNewOutboundPeer(bool flag)
Definition: net.cpp:1631
NetEventsInterface * m_msgproc
Definition: net.h:414
unsigned int nHdrPos
Definition: net.h:583
std::string cleanSubVer GUARDED_BY(cs_SubVer)
Definition: net.h:658
unsigned int nDataPos
Definition: net.h:586
#define NO_THREAD_SAFETY_ANALYSIS
Definition: thread_annotations.h:57
Definition: netaddress.h:102
CCriticalSection cs_inventory
Definition: net.h:711
bool DisconnectNode(const std::string &node)
Definition: net.cpp:2450
CCriticalSection cs_totalBytesSent
Definition: net.h:368
Definition: uint256.h:121
void RemoveLocal(const CService &addr)
Definition: net.cpp:235
std::atomic< int64_t > nLastSend
Definition: net.h:644
uint256 hashContinue
Definition: net.h:691
std::atomic< int64_t > nLastBlockTime
Definition: net.h:722
int nPort
Definition: net.h:529
static const unsigned int MAX_ADDR_TO_SEND
Definition: net.h:53
virtual void InitializeNode(CNode *pnode)=0
int64_t nLastRecv
Definition: net.h:545
void MaybeSetAddrName(const std::string &addrNameIn)
Sets the addrName only if it was not previously set.
Definition: net.cpp:471
void OpenNetworkConnection(const CAddress &addrConnect, bool fCountFailure, CSemaphoreGrant *grantOutbound=nullptr, const char *strDest=nullptr, bool fOneShot=false, bool fFeeler=false, bool manual_connection=false)
Definition: net.cpp:1906
void WakeMessageHandler()
Definition: net.cpp:1381
std::thread threadOpenConnections
Definition: net.h:432
double dMinPing
Definition: net.h:561
int GetSendVersion() const
Definition: net.cpp:620
int64_t nTimeConnected
Definition: net.h:546
static const size_t DEFAULT_MAXSENDBUFFER
Definition: net.h:83
std::condition_variable condMsgProc
Definition: net.h:423
int nScore
Definition: net.h:528
bool fAddressesInitialized
Definition: net.h:390
mapMsgCmdSize mapSendBytesPerMsgCmd
Definition: net.h:555
virtual bool SendMessages(CNode *pnode)=0
ServiceFlags nLocalServices
Definition: init.cpp:882
bool operator()(I first, I last) const
Definition: net.h:458
NetEventsInterface * m_msgproc
Definition: net.h:133
static const uint64_t DEFAULT_MAX_UPLOAD_TARGET
Definition: net.h:73
int nSendVersion
Definition: net.h:755
int64_t nextSendTimeFeeFilter
Definition: net.h:740
ServiceFlags nServices
Definition: net.h:542
void PushBlockHash(const uint256 &hash)
Definition: net.h:854
uint64_t GetTotalBytesSent()
Definition: net.cpp:2592
void SetMaxOutboundTarget(uint64_t limit)
set the max outbound target in bytes
Definition: net.cpp:2513
void AddInventoryKnown(const CInv &inv)
Definition: net.h:834
std::string strAddedNode
Definition: net.h:89
std::atomic< int64_t > nLastTXTime
Definition: net.h:723
bool ForNode(NodeId id, std::function< bool(CNode *pnode)> func)
Definition: net.cpp:2692
std::map< std::string, uint64_t > mapMsgCmdSize
Definition: net.h:536
void ThreadSocketHandler()
Definition: net.cpp:1371
ServiceFlags GetLocalServices() const
Definition: net.cpp:2598
void ForEachNodeThen(Callable &&pre, CallableAfter &&post)
Definition: net.h:221
std::atomic< bool > fPingQueued
Definition: net.h:735
CCriticalSection cs_filter
Definition: net.h:678
int nVersion
Definition: net.h:549
void ThreadDNSAddressSeed()
Definition: net.cpp:1522
uint64_t GetMaxOutboundTimeLeftInCycle()
Definition: net.cpp:2531
bool GetTryNewOutboundPeer()
Definition: net.cpp:1626
int64_t PoissonNextSend(int64_t now, int average_interval_seconds)
Definition: net.cpp:2716
std::atomic< int64_t > timeLastMempoolReq
Definition: net.h:719
bool fSentAddr
Definition: net.h:676
std::thread threadMessageHandler
Definition: net.h:433
bool Start(CScheduler &scheduler, const Options &options)
Definition: net.cpp:2177
unsigned int nSendBufferMaxSize
Definition: net.h:135
CNode * FindNode(const CNetAddr &ip)
Definition: net.cpp:281
int64_t nLastSend
Definition: net.h:544
int type
Definition: protocol.h:403
virtual bool ProcessMessages(CNode *pnode, std::atomic< bool > &interrupt)=0
Definition: protocol.h:382
Definition: netaddress.h:140
CMessageHeader hdr
Definition: net.h:582
static const unsigned int MAX_SUBVERSION_LENGTH
Definition: net.h:57
int nMaxConnections
Definition: net.h:127
static const bool DEFAULT_UPNP
Definition: net.h:68
std::vector< std::string > m_added_nodes
Definition: net.h:145
static const int64_t DEFAULT_PEER_CONNECT_TIMEOUT
Definition: net.h:79
bool IsWhitelistedRange(const CNetAddr &addr)
Definition: net.cpp:458
NodeId nodeid
Definition: net.h:541
static const bool DEFAULT_BLOCKSONLY
Definition: net.h:77
CSemaphoreGrant grantOutbound
Definition: net.h:677
signed long long int64_t
Definition: stdint.h:18
const NodeId id
Definition: net.h:750
CSipHasher GetDeterministicRandomizer(uint64_t id) const
Definition: net.cpp:2721
static const int PING_INTERVAL
Definition: net.h:43
int64_t nNextInvSend
Definition: net.h:712
void Interrupt()
Definition: net.cpp:2293
std::unique_ptr< CSemaphore > semAddnode
Definition: net.h:406
CCriticalSection cs_sendProcessing
Definition: net.h:638
std::atomic< int64_t > nTimeOffset
Definition: net.h:647
const uint64_t nKeyedNetGroup
Definition: net.h:682
CCriticalSection cs_vNodes
Definition: net.h:398
std::set< uint256 > setInventoryTxToSend
Definition: net.h:706
uint64_t nRecvBytes GUARDED_BY(cs_vRecv)
Definition: net.h:641
std::string strSubVersion
Definition: net.cpp:86
Definition: addrman.h:175
std::thread threadOpenAddedConnections
Definition: net.h:431
int64_t nTime
Definition: net.h:588
std::atomic< int > nBestHeight
Definition: net.h:412
std::unique_ptr< CSemaphore > semOutbound
Definition: net.h:405
bool m_use_addrman_outgoing
Definition: net.h:143
NodeId GetNewNodeId()
Definition: net.cpp:2140
void SetReachable(enum Network net, bool reachable)
Definition: net.cpp:242
void AddOneShot(const std::string &strDest)
Definition: net.cpp:88
void AcceptConnection(const ListenSocket &hListenSocket)
Definition: net.cpp:889
bool m_manual_connection
Definition: net.h:663
bool AttemptToEvictConnection()
Definition: net.cpp:805
CCriticalSection cs_totalBytesRecv
Definition: net.h:367
std::vector< std::string > vSeedNodes
Definition: net.h:140
const int64_t nTimeConnected
Definition: net.h:646
const int nMyStartingHeight
Definition: net.h:754
std::vector< CAddress > GetAddresses()
Definition: net.cpp:2395
bool fDiscover
Definition: net.cpp:80
int GetExtraOutboundCount()
Definition: net.cpp:1643
int readHeader(const char *pch, unsigned int nBytes)
Definition: net.cpp:633
CCriticalSection cs_addrName
Definition: net.h:758
bool fOneShot
Definition: net.h:662
void ForEachNode(Callable &&func)
Definition: net.h:201
void Stop() NO_THREAD_SAFETY_ANALYSIS
Definition: net.cpp:2317
int64_t nNextLocalAddrSend GUARDED_BY(cs_sendProcessing)
Definition: net.h:700
void SetNetworkActive(bool active)
Definition: net.cpp:2119
mapMsgCmdSize mapSendBytesPerMsgCmd
Definition: net.h:687
size_t nSendOffset
Definition: net.h:627
CAddress GetLocalAddress(const CNetAddr *paddrPeer, ServiceFlags nLocalServices)
Definition: net.cpp:149
static const unsigned int MAX_INV_SZ
Definition: net.h:49
bool AddLocal(const CService &addr, int nScore=LOCAL_NONE)
Definition: net.cpp:204
bool m_limited_node
Definition: net.h:665
CDataStream vRecv
Definition: net.h:585
uint64_t nRecvBytes
Definition: net.h:556
bool IsLocal(const CService &addr)
Definition: net.cpp:275
RecursiveMutex cs_SubVer
Definition: net.h:653
CCriticalSection cs_mapLocalHost
Definition: net.cpp:83
void SetSendVersion(int nVersionIn)
Definition: net.cpp:606
void SocketEvents(std::set< SOCKET > &recv_set, std::set< SOCKET > &send_set, std::set< SOCKET > &error_set)
Definition: net.cpp:1173
void DisconnectNodes()
Definition: net.cpp:975
void RecordBytesRecv(uint64_t bytes)
Definition: net.cpp:2490
void SetMaxOutboundTimeframe(uint64_t timeframe)
set the timeframe for the max outbound target
Definition: net.cpp:2545
std::atomic< int > nVersion
Definition: net.h:652
unsigned short GetListenPort()
Definition: net.cpp:94
int nBestHeight
Definition: net.h:131
bool complete() const
Definition: net.h:598
bool AddNode(const std::string &node)
Definition: net.cpp:2400
size_t SocketSendData(CNode *pnode) const
Definition: net.cpp:689
bool GenerateSelectSet(std::set< SOCKET > &recv_set, std::set< SOCKET > &send_set, std::set< SOCKET > &error_set)
Definition: net.cpp:1084
std::list< CNetMessage > vRecvMsg
Definition: net.h:756
Definition: ui_interface.h:34
CAmount minFeeFilter
Definition: net.h:562
CCriticalSection cs_vProcessMsg
Definition: net.h:634