Raven Core  3.0.0
P2P Digital Currency
Public Member Functions | Private Attributes | List of all members
PeerLogicValidation Class Reference

#include <net_processing.h>

Inheritance diagram for PeerLogicValidation:
[legend]
Collaboration diagram for PeerLogicValidation:
[legend]

Public Member Functions

 PeerLogicValidation (CConnman *connman, CScheduler &scheduler)
 
void BlockConnected (const std::shared_ptr< const CBlock > &pblock, const CBlockIndex *pindexConnected, const std::vector< CTransactionRef > &vtxConflicted) override
 Notifies listeners of a block being connected. More...
 
void UpdatedBlockTip (const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override
 Notifies listeners of updated block chain tip. More...
 
void BlockChecked (const CBlock &block, const CValidationState &state) override
 Notifies listeners of a block validation result. More...
 
void NewPoWValidBlock (const CBlockIndex *pindex, const std::shared_ptr< const CBlock > &pblock) override
 Notifies listeners that a block which builds directly on our current tip has been received and connected to the headers tree, though not validated yet. More...
 
void InitializeNode (CNode *pnode) override
 
void FinalizeNode (NodeId nodeid, bool &fUpdateConnectionTime) override
 
bool ProcessMessages (CNode *pfrom, std::atomic< bool > &interrupt) override
 Process protocol messages received from a given node. More...
 
bool SendMessages (CNode *pto, std::atomic< bool > &interrupt) override
 Send queued protocol messages to be sent to a give node. More...
 
void ConsiderEviction (CNode *pto, int64_t time_in_seconds)
 
void CheckForStaleTipAndEvictPeers (const Consensus::Params &consensusParams)
 
void EvictExtraOutboundPeers (int64_t time_in_seconds)
 

Private Attributes

CConnman *const connman
 
int64_t m_stale_tip_check_time
 

Additional Inherited Members

- Protected Member Functions inherited from CValidationInterface
virtual void TransactionAddedToMempool (const CTransactionRef &ptxn)
 Notifies listeners of a transaction having been added to mempool. More...
 
virtual void BlockDisconnected (const std::shared_ptr< const CBlock > &block)
 Notifies listeners of a block being disconnected. More...
 
virtual void SetBestChain (const CBlockLocator &locator)
 Notifies listeners of the new active block chain on-disk. More...
 
virtual void Inventory (const uint256 &hash)
 Notifies listeners about an inventory item being seen on the network. More...
 
virtual void ResendWalletTransactions (int64_t nBestBlockTime, CConnman *connman)
 Tells listeners to broadcast their data. More...
 
virtual void BlockFound (const uint256 &hash)
 
virtual void NewAssetMessage (const CMessage &message)
 
friend void ::RegisterValidationInterface (CValidationInterface *)
 
friend void ::UnregisterValidationInterface (CValidationInterface *)
 
friend void ::UnregisterAllValidationInterfaces ()
 

Detailed Description

Definition at line 39 of file net_processing.h.

Constructor & Destructor Documentation

◆ PeerLogicValidation()

PeerLogicValidation::PeerLogicValidation ( CConnman connman,
CScheduler scheduler 
)
explicit

Definition at line 785 of file net_processing.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ BlockChecked()

void PeerLogicValidation::BlockChecked ( const CBlock ,
const CValidationState  
)
overridevirtual

Notifies listeners of a block validation result.

If the provided CValidationState IsValid, the provided block is guaranteed to be the current best block at the time the callback was generated (not necessarily now)

Reimplemented from CValidationInterface.

Definition at line 909 of file net_processing.cpp.

Here is the call graph for this function:

◆ BlockConnected()

void PeerLogicValidation::BlockConnected ( const std::shared_ptr< const CBlock > &  block,
const CBlockIndex pindex,
const std::vector< CTransactionRef > &  txnConflicted 
)
overridevirtual

Notifies listeners of a block being connected.

Provides a vector of transactions evicted from the mempool as a result.

Reimplemented from CValidationInterface.

Definition at line 798 of file net_processing.cpp.

Here is the call graph for this function:

◆ CheckForStaleTipAndEvictPeers()

void PeerLogicValidation::CheckForStaleTipAndEvictPeers ( const Consensus::Params consensusParams)

Definition at line 3192 of file net_processing.cpp.

Here is the call graph for this function:

◆ ConsiderEviction()

void PeerLogicValidation::ConsiderEviction ( CNode pto,
int64_t  time_in_seconds 
)

Definition at line 3085 of file net_processing.cpp.

Here is the call graph for this function:

◆ EvictExtraOutboundPeers()

void PeerLogicValidation::EvictExtraOutboundPeers ( int64_t  time_in_seconds)

Definition at line 3137 of file net_processing.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FinalizeNode()

void PeerLogicValidation::FinalizeNode ( NodeId  nodeid,
bool &  fUpdateConnectionTime 
)
overridevirtual

Implements NetEventsInterface.

Definition at line 573 of file net_processing.cpp.

Here is the call graph for this function:

◆ InitializeNode()

void PeerLogicValidation::InitializeNode ( CNode pnode)
overridevirtual

Implements NetEventsInterface.

Definition at line 561 of file net_processing.cpp.

Here is the call graph for this function:

◆ NewPoWValidBlock()

void PeerLogicValidation::NewPoWValidBlock ( const CBlockIndex pindex,
const std::shared_ptr< const CBlock > &  block 
)
overridevirtual

Notifies listeners that a block which builds directly on our current tip has been received and connected to the headers tree, though not validated yet.

Reimplemented from CValidationInterface.

Definition at line 837 of file net_processing.cpp.

◆ ProcessMessages()

bool PeerLogicValidation::ProcessMessages ( CNode pfrom,
std::atomic< bool > &  interrupt 
)
overridevirtual

Process protocol messages received from a given node.

Implements NetEventsInterface.

Definition at line 2965 of file net_processing.cpp.

Here is the call graph for this function:

◆ SendMessages()

bool PeerLogicValidation::SendMessages ( CNode pto,
std::atomic< bool > &  interrupt 
)
overridevirtual

Send queued protocol messages to be sent to a give node.

Parameters
[in]ptoThe node which we are sending messages to.
[in]interruptInterrupt condition for processing threads
Returns
True if there is more work to be done

Implements NetEventsInterface.

Definition at line 3231 of file net_processing.cpp.

Here is the call graph for this function:

◆ UpdatedBlockTip()

void PeerLogicValidation::UpdatedBlockTip ( const CBlockIndex pindexNew,
const CBlockIndex pindexFork,
bool  fInitialDownload 
)
overridevirtual

Notifies listeners of updated block chain tip.

Reimplemented from CValidationInterface.

Definition at line 878 of file net_processing.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ connman

CConnman* const PeerLogicValidation::connman
private

Definition at line 41 of file net_processing.h.

◆ m_stale_tip_check_time

int64_t PeerLogicValidation::m_stale_tip_check_time
private

Definition at line 70 of file net_processing.h.


The documentation for this class was generated from the following files: