Ethereum  PoC-8
The C++ Implementation of Ethereum
dev::eth::EthereumPeer Class Reference

#include <EthereumPeer.h>

Public Member Functions

 EthereumPeer ()=default
 
 EthereumPeer (std::shared_ptr< p2p::CapabilityHostFace > _host, NodeID const &_peerID, u256 const &)
 
void setStatus (unsigned _protocolVersion, u256 const &_networkId, u256 const &_totalDifficulty, h256 const &_latestHash, h256 const &_genesisHash)
 
std::string validate (h256 const &_hostGenesisHash, unsigned _hostProtocolVersion, u256 const &_hostNetworkId) const
 
NodeID id () const
 
u256 totalDifficulty () const
 
time_t lastAsk () const
 
void setLastAsk (time_t _lastAsk)
 
Asking asking () const
 
bool isConversing () const
 
void setAsking (Asking _asking)
 
h256 latestHash () const
 
void setLatestHash (h256 const &_hash)
 
bool isWaitingForTransactions () const
 
void setWaitingForTransactions (bool _value)
 
bool isTransactionKnown (h256 const &_hash) const
 
void markTransactionAsKnown (h256 const &_hash)
 
bool isBlockKnown (h256 const &_hash) const
 
void markBlockAsKnown (h256 const &_hash)
 
void clearKnownBlocks ()
 
unsigned unknownNewBlocks () const
 
void incrementUnknownNewBlocks ()
 
void requestStatus (u256 _hostNetworkId, u256 _chainTotalDifficulty, h256 _chainCurrentHash, h256 _chainGenesPeersh)
 
void requestBlockHeaders (h256 const &_startHash, unsigned _count, unsigned _skip, bool _reverse)
 Request hashes for given parent hash. More...
 
void requestBlockHeaders (unsigned _startNumber, unsigned _count, unsigned _skip, bool _reverse)
 
void requestBlockBodies (h256s const &_blocks)
 Request specified blocks from peer. More...
 
void requestNodeData (h256s const &_hashes)
 Request values for specified keys from peer. More...
 
void requestReceipts (h256s const &_blocks)
 Request receipts for specified blocks from peer. More...
 

Detailed Description

Definition at line 31 of file EthereumPeer.h.

Constructor & Destructor Documentation

◆ EthereumPeer() [1/2]

dev::eth::EthereumPeer::EthereumPeer ( )
default

◆ EthereumPeer() [2/2]

dev::eth::EthereumPeer::EthereumPeer ( std::shared_ptr< p2p::CapabilityHostFace >  _host,
NodeID const &  _peerID,
u256 const &   
)
inline

Definition at line 35 of file EthereumPeer.h.

Member Function Documentation

◆ asking()

Asking dev::eth::EthereumPeer::asking ( ) const
inline

Definition at line 53 of file EthereumPeer.h.

◆ clearKnownBlocks()

void dev::eth::EthereumPeer::clearKnownBlocks ( )
inline

Definition at line 68 of file EthereumPeer.h.

◆ id()

NodeID dev::eth::EthereumPeer::id ( ) const
inline

Definition at line 46 of file EthereumPeer.h.

◆ incrementUnknownNewBlocks()

void dev::eth::EthereumPeer::incrementUnknownNewBlocks ( )
inline

Definition at line 71 of file EthereumPeer.h.

◆ isBlockKnown()

bool dev::eth::EthereumPeer::isBlockKnown ( h256 const &  _hash) const
inline

Definition at line 66 of file EthereumPeer.h.

◆ isConversing()

bool dev::eth::EthereumPeer::isConversing ( ) const
inline

Definition at line 54 of file EthereumPeer.h.

◆ isTransactionKnown()

bool dev::eth::EthereumPeer::isTransactionKnown ( h256 const &  _hash) const
inline

Definition at line 63 of file EthereumPeer.h.

◆ isWaitingForTransactions()

bool dev::eth::EthereumPeer::isWaitingForTransactions ( ) const
inline

Definition at line 60 of file EthereumPeer.h.

◆ lastAsk()

time_t dev::eth::EthereumPeer::lastAsk ( ) const
inline

Definition at line 50 of file EthereumPeer.h.

◆ latestHash()

h256 dev::eth::EthereumPeer::latestHash ( ) const
inline

Definition at line 57 of file EthereumPeer.h.

◆ markBlockAsKnown()

void dev::eth::EthereumPeer::markBlockAsKnown ( h256 const &  _hash)
inline

Definition at line 67 of file EthereumPeer.h.

◆ markTransactionAsKnown()

void dev::eth::EthereumPeer::markTransactionAsKnown ( h256 const &  _hash)
inline

Definition at line 64 of file EthereumPeer.h.

◆ requestBlockBodies()

void EthereumPeer::requestBlockBodies ( h256s const &  _blocks)

Request specified blocks from peer.

Definition at line 131 of file EthereumPeer.cpp.

◆ requestBlockHeaders() [1/2]

void EthereumPeer::requestBlockHeaders ( h256 const &  _startHash,
unsigned  _count,
unsigned  _skip,
bool  _reverse 
)

Request hashes for given parent hash.

Definition at line 113 of file EthereumPeer.cpp.

◆ requestBlockHeaders() [2/2]

void EthereumPeer::requestBlockHeaders ( unsigned  _startNumber,
unsigned  _count,
unsigned  _skip,
bool  _reverse 
)

Definition at line 96 of file EthereumPeer.cpp.

◆ requestNodeData()

void EthereumPeer::requestNodeData ( h256s const &  _hashes)

Request values for specified keys from peer.

Definition at line 136 of file EthereumPeer.cpp.

◆ requestReceipts()

void EthereumPeer::requestReceipts ( h256s const &  _blocks)

Request receipts for specified blocks from peer.

Definition at line 141 of file EthereumPeer.cpp.

◆ requestStatus()

void EthereumPeer::requestStatus ( u256  _hostNetworkId,
u256  _chainTotalDifficulty,
h256  _chainCurrentHash,
h256  _chainGenesPeersh 
)

Definition at line 83 of file EthereumPeer.cpp.

◆ setAsking()

void dev::eth::EthereumPeer::setAsking ( Asking  _asking)
inline

Definition at line 55 of file EthereumPeer.h.

◆ setLastAsk()

void dev::eth::EthereumPeer::setLastAsk ( time_t  _lastAsk)
inline

Definition at line 51 of file EthereumPeer.h.

◆ setLatestHash()

void dev::eth::EthereumPeer::setLatestHash ( h256 const &  _hash)
inline

Definition at line 58 of file EthereumPeer.h.

◆ setStatus()

void EthereumPeer::setStatus ( unsigned  _protocolVersion,
u256 const &  _networkId,
u256 const &  _totalDifficulty,
h256 const &  _latestHash,
h256 const &  _genesisHash 
)

Definition at line 56 of file EthereumPeer.cpp.

◆ setWaitingForTransactions()

void dev::eth::EthereumPeer::setWaitingForTransactions ( bool  _value)
inline

Definition at line 61 of file EthereumPeer.h.

◆ totalDifficulty()

u256 dev::eth::EthereumPeer::totalDifficulty ( ) const
inline

Definition at line 48 of file EthereumPeer.h.

◆ unknownNewBlocks()

unsigned dev::eth::EthereumPeer::unknownNewBlocks ( ) const
inline

Definition at line 70 of file EthereumPeer.h.

◆ validate()

std::string EthereumPeer::validate ( h256 const &  _hostGenesisHash,
unsigned  _hostProtocolVersion,
u256 const &  _hostNetworkId 
) const

Definition at line 67 of file EthereumPeer.cpp.


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