Dogecoin Core  1.14.2
P2P Digital Currency
net_processing.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2016 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 
13 static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100;
15 static const int64_t ORPHAN_TX_EXPIRE_TIME = 20 * 60;
17 static const int64_t ORPHAN_TX_EXPIRE_INTERVAL = 5 * 60;
19 static const unsigned int DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN = 100;
20 
22 void RegisterNodeSignals(CNodeSignals& nodeSignals);
24 void UnregisterNodeSignals(CNodeSignals& nodeSignals);
25 
27 private:
29 
30 public:
31  PeerLogicValidation(CConnman* connmanIn);
32 
33  virtual void SyncTransaction(const CTransaction& tx, const CBlockIndex* pindex, int nPosInBlock);
34  virtual void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload);
35  virtual void BlockChecked(const CBlock& block, const CValidationState& state);
36  virtual void NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_ptr<const CBlock>& pblock);
37 };
38 
43  std::vector<int> vHeightInFlight;
44 };
45 
47 bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats);
49 void Misbehaving(NodeId nodeid, int howmuch);
50 
52 bool ProcessMessages(CNode* pfrom, CConnman& connman, const std::atomic<bool>& interrupt);
61 bool SendMessages(CNode* pto, CConnman& connman, const std::atomic<bool>& interrupt);
62 
63 #endif // BITCOIN_NET_PROCESSING_H
Definition: block.h:67
The block chain is a tree shaped structure starting with the genesis block at the root,...
Definition: chain.h:158
Definition: net.h:125
Information about a peer.
Definition: net.h:564
The basic transaction that is broadcasted on the network and contained in blocks.
Definition: transaction.h:308
Capture information about block/transaction validation.
Definition: validation.h:22
virtual void BlockChecked(const CBlock &block, const CValidationState &state)
virtual void NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_ptr< const CBlock > &pblock)
PeerLogicValidation(CConnman *connmanIn)
virtual void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload)
virtual void SyncTransaction(const CTransaction &tx, const CBlockIndex *pindex, int nPosInBlock)
int64_t NodeId
Definition: net.h:96
void UnregisterNodeSignals(CNodeSignals &nodeSignals)
Unregister a network node.
void Misbehaving(NodeId nodeid, int howmuch)
Increase a node's misbehavior score.
bool ProcessMessages(CNode *pfrom, CConnman &connman, const std::atomic< bool > &interrupt)
Process protocol messages received from a given node.
void RegisterNodeSignals(CNodeSignals &nodeSignals)
Register with a network node to receive its signals.
bool SendMessages(CNode *pto, CConnman &connman, const std::atomic< bool > &interrupt)
Send queued protocol messages to be sent to a give node.
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats)
Get statistics from node state.
std::vector< int > vHeightInFlight