#include <net_processing.h>
|
| PeerLogicValidation (CConnman *connman, BanMan *banman, CScheduler &scheduler, bool enable_bip61) |
|
void | BlockConnected (const std::shared_ptr< const CBlock > &pblock, const CBlockIndex *pindexConnected, const std::vector< CTransactionRef > &vtxConflicted) override |
|
void | UpdatedBlockTip (const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override |
|
void | BlockChecked (const CBlock &block, const CValidationState &state) override |
|
void | NewPoWValidBlock (const CBlockIndex *pindex, const std::shared_ptr< const CBlock > &pblock) override |
|
void | InitializeNode (CNode *pnode) override |
|
void | FinalizeNode (NodeId nodeid, bool &fUpdateConnectionTime) override |
|
bool | ProcessMessages (CNode *pfrom, std::atomic< bool > &interrupt) override |
|
bool | SendMessages (CNode *pto) override EXCLUSIVE_LOCKS_REQUIRED(pto -> cs_sendProcessing) |
|
void | ConsiderEviction (CNode *pto, int64_t time_in_seconds) EXCLUSIVE_LOCKS_REQUIRED(cs_main) |
|
void | CheckForStaleTipAndEvictPeers (const Consensus::Params &consensusParams) |
|
void | EvictExtraOutboundPeers (int64_t time_in_seconds) EXCLUSIVE_LOCKS_REQUIRED(cs_main) |
|
◆ PeerLogicValidation()
PeerLogicValidation::PeerLogicValidation |
( |
CConnman * |
connman, |
|
|
BanMan * |
banman, |
|
|
CScheduler & |
scheduler, |
|
|
bool |
enable_bip61 |
|
) |
| |
◆ BlockChecked()
◆ BlockConnected()
void PeerLogicValidation::BlockConnected |
( |
const std::shared_ptr< const CBlock > & |
pblock, |
|
|
const CBlockIndex * |
pindex, |
|
|
const std::vector< CTransactionRef > & |
vtxConflicted |
|
) |
| |
|
overridevirtual |
Overridden from CValidationInterface.
Evict orphan txn pool entries (EraseOrphanTx) based on a newly connected block. Also save the time of the last tip update.
Reimplemented from CValidationInterface.
◆ CheckForStaleTipAndEvictPeers()
void PeerLogicValidation::CheckForStaleTipAndEvictPeers |
( |
const Consensus::Params & |
consensusParams | ) |
|
Evict extra outbound peers. If we think our tip may be stale, connect to an extra outbound
◆ ConsiderEviction()
void PeerLogicValidation::ConsiderEviction |
( |
CNode * |
pto, |
|
|
int64_t |
time_in_seconds |
|
) |
| |
Consider evicting an outbound peer based on the amount of time they've been behind our tip
◆ EvictExtraOutboundPeers()
void PeerLogicValidation::EvictExtraOutboundPeers |
( |
int64_t |
time_in_seconds | ) |
|
If we have extra outbound peers, try to disconnect the one with the oldest block announcement
◆ FinalizeNode()
void PeerLogicValidation::FinalizeNode |
( |
NodeId |
nodeid, |
|
|
bool & |
fUpdateConnectionTime |
|
) |
| |
|
overridevirtual |
Handle removal of a peer by updating various state and removing it from mapNodeState
Implements NetEventsInterface.
◆ InitializeNode()
void PeerLogicValidation::InitializeNode |
( |
CNode * |
pnode | ) |
|
|
overridevirtual |
Initialize a peer by adding it to mapNodeState and pushing a message requesting its version
Implements NetEventsInterface.
◆ NewPoWValidBlock()
void PeerLogicValidation::NewPoWValidBlock |
( |
const CBlockIndex * |
pindex, |
|
|
const std::shared_ptr< const CBlock > & |
pblock |
|
) |
| |
|
overridevirtual |
◆ ProcessMessages()
bool PeerLogicValidation::ProcessMessages |
( |
CNode * |
pfrom, |
|
|
std::atomic< bool > & |
interrupt |
|
) |
| |
|
overridevirtual |
Process protocol messages received from a given node
- Parameters
-
[in] | pfrom | The node which we have received messages from. |
[in] | interrupt | Interrupt condition for processing threads |
Implements NetEventsInterface.
◆ SendMessages()
bool PeerLogicValidation::SendMessages |
( |
CNode * |
pto | ) |
-> cs_sendProcessing) |
|
overridevirtual |
Send queued protocol messages to be sent to a give node.
- Parameters
-
[in] | pto | The node which we are sending messages to. |
- Returns
- True if there is more work to be done
Implements NetEventsInterface.
◆ SendRejectsAndCheckIfBanned()
bool PeerLogicValidation::SendRejectsAndCheckIfBanned |
( |
CNode * |
pnode, |
|
|
bool |
enable_bip61 |
|
) |
| |
|
private |
◆ UpdatedBlockTip()
void PeerLogicValidation::UpdatedBlockTip |
( |
const CBlockIndex * |
pindexNew, |
|
|
const CBlockIndex * |
pindexFork, |
|
|
bool |
fInitialDownload |
|
) |
| |
|
overridevirtual |
◆ connman
CConnman* const PeerLogicValidation::connman |
|
private |
◆ m_banman
BanMan* const PeerLogicValidation::m_banman |
|
private |
◆ m_enable_bip61
const bool PeerLogicValidation::m_enable_bip61 |
|
private |
Enable BIP61 (sending reject messages)
◆ m_stale_tip_check_time
int64_t PeerLogicValidation::m_stale_tip_check_time |
|
private |
Next time to check for stale tip.
The documentation for this class was generated from the following files: