6 #ifndef BITCOIN_NET_PROCESSING_H 7 #define BITCOIN_NET_PROCESSING_H 17 static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100;
19 static const unsigned int DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN = 100;
21 static constexpr
bool DEFAULT_ENABLE_BIP61{
false};
33 void BlockConnected(
const std::shared_ptr<const CBlock>& pblock,
const CBlockIndex* pindexConnected,
const std::vector<CTransactionRef>& vtxConflicted)
override;
90 #endif // BITCOIN_NET_PROCESSING_H
void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override
Overridden from CValidationInterface.
void CheckForStaleTipAndEvictPeers(const Consensus::Params &consensusParams)
Evict extra outbound peers.
bool SendMessages(CNode *pto) override EXCLUSIVE_LOCKS_REQUIRED(pto -> cs_sendProcessing)
Send queued protocol messages to be sent to a give node.
PeerLogicValidation(CConnman *connman, CScheduler &scheduler, bool enable_bip61)
Interface for message handling.
const bool m_enable_bip61
Enable BIP61 (sending reject messages)
Implement this to subscribe to events generated in validation.
bool ProcessMessages(CNode *pfrom, std::atomic< bool > &interrupt) override
Process protocol messages received from a given node.
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats)
Get statistics from node state.
void ConsiderEviction(CNode *pto, int64_t time_in_seconds) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Consider evicting an outbound peer based on the amount of time they've been behind our tip...
Parameters that influence chain consensus.
void EvictExtraOutboundPeers(int64_t time_in_seconds) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
If we have extra outbound peers, try to disconnect the one with the oldest block announcement.
int64_t m_stale_tip_check_time
Next time to check for stale tip.
void BlockConnected(const std::shared_ptr< const CBlock > &pblock, const CBlockIndex *pindexConnected, const std::vector< CTransactionRef > &vtxConflicted) override
Overridden from CValidationInterface.
Capture information about block/transaction validation.
void NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_ptr< const CBlock > &pblock) override
Overridden from CValidationInterface.
#define EXCLUSIVE_LOCKS_REQUIRED(...)
The block chain is a tree shaped structure starting with the genesis block at the root...
void BlockChecked(const CBlock &block, const CValidationState &state) override
Overridden from CValidationInterface.
void FinalizeNode(NodeId nodeid, bool &fUpdateConnectionTime) override
Handle removal of a peer by updating various state and removing it from mapNodeState.
Information about a peer.
std::vector< int > vHeightInFlight
void InitializeNode(CNode *pnode) override
Initialize a peer by adding it to mapNodeState and pushing a message requesting its version...