Dash Core  0.12.2.1
P2P Digital Currency
net_processing.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2015 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef BITCOIN_NET_PROCESSING_H
7 #define BITCOIN_NET_PROCESSING_H
8 
9 #include "net.h"
10 #include "validationinterface.h"
11 
14 static constexpr int64_t HEADERS_DOWNLOAD_TIMEOUT_BASE = 15 * 60 * 1000000; // 15 minutes
15 static constexpr int64_t HEADERS_DOWNLOAD_TIMEOUT_PER_HEADER = 1000; // 1ms/header
16 
18 void RegisterNodeSignals(CNodeSignals& nodeSignals);
20 void UnregisterNodeSignals(CNodeSignals& nodeSignals);
21 
23 private:
25 
26 public:
27  PeerLogicValidation(CConnman* connmanIn);
28 
29  virtual void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload);
30  virtual void BlockChecked(const CBlock& block, const CValidationState& state);
31 };
32 
37  std::vector<int> vHeightInFlight;
38 };
39 
41 bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats);
43 void Misbehaving(NodeId nodeid, int howmuch);
44 
46 bool ProcessMessages(CNode* pfrom, CConnman& connman, std::atomic<bool>& interrupt);
55 bool SendMessages(CNode* pto, CConnman& connman, std::atomic<bool>& interrupt);
56 
57 #endif // BITCOIN_NET_PROCESSING_H
void Misbehaving(NodeId nodeid, int howmuch)
static constexpr int64_t HEADERS_DOWNLOAD_TIMEOUT_PER_HEADER
Definition: net.h:108
std::vector< int > vHeightInFlight
bool SendMessages(CNode *pto, CConnman &connman, std::atomic< bool > &interrupt)
void UnregisterNodeSignals(CNodeSignals &nodeSignals)
PeerLogicValidation(CConnman *connmanIn)
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats)
virtual void BlockChecked(const CBlock &block, const CValidationState &state)
Definition: net.h:661
bool ProcessMessages(CNode *pfrom, CConnman &connman, std::atomic< bool > &interrupt)
static constexpr int64_t HEADERS_DOWNLOAD_TIMEOUT_BASE
void RegisterNodeSignals(CNodeSignals &nodeSignals)
int NodeId
Definition: net.h:94
virtual void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload)
Definition: block.h:73