The EthereumCapability class.
More...
#include <EthereumCapability.h>
|
| | EthereumCapability (std::shared_ptr< p2p::CapabilityHostFace > _host, BlockChain const &_ch, OverlayDB const &_db, TransactionQueue &_tq, BlockQueue &_bq, u256 _networkId) |
| | Start server, but don't listen. More...
|
| |
| std::string | name () const override |
| |
| unsigned | version () const override |
| |
| p2p::CapDesc | descriptor () const override |
| |
| unsigned | messageCount () const override |
| |
| std::chrono::milliseconds | backgroundWorkInterval () const override |
| |
| unsigned | protocolVersion () const |
| |
| u256 | networkId () const |
| |
| void | setNetworkId (u256 _n) |
| |
| void | reset () |
| |
| void | completeSync () |
| | Don't sync further - used only in test mode. More...
|
| |
| bool | isSyncing () const |
| |
| void | noteNewTransactions () |
| |
| void | noteNewBlocks () |
| |
| void | onBlockImported (BlockHeader const &_info) |
| |
| BlockChain const & | chain () const |
| |
| OverlayDB const & | db () const |
| |
| BlockQueue & | bq () |
| |
| BlockQueue const & | bq () const |
| |
| SyncStatus | status () const |
| |
| void | onConnect (NodeID const &_nodeID, u256 const &_peerCapabilityVersion) override |
| |
| void | onDisconnect (NodeID const &_nodeID) override |
| |
| bool | interpretCapabilityPacket (NodeID const &_peerID, unsigned _id, RLP const &_r) override |
| |
| void | doBackgroundWork () override |
| |
| p2p::CapabilityHostFace & | capabilityHost () |
| |
| EthereumPeer const & | peer (NodeID const &_peerID) const |
| |
| EthereumPeer & | peer (NodeID const &_peerID) |
| |
| void | disablePeer (NodeID const &_peerID, std::string const &_problem) |
| |
The EthereumCapability class.
- Warning
- None of this is thread-safe. You have been warned. @doWork Syncs to peers and sends new blocks and transactions.
Definition at line 84 of file EthereumCapability.h.
◆ EthereumCapability()
◆ backgroundWorkInterval()
| std::chrono::milliseconds EthereumCapability::backgroundWorkInterval |
( |
| ) |
const |
|
override |
◆ bq() [1/2]
◆ bq() [2/2]
| BlockQueue const& dev::eth::EthereumCapability::bq |
( |
| ) |
const |
|
inline |
◆ capabilityHost()
| p2p::CapabilityHostFace& dev::eth::EthereumCapability::capabilityHost |
( |
| ) |
|
|
inline |
◆ chain()
| BlockChain const& dev::eth::EthereumCapability::chain |
( |
| ) |
const |
|
inline |
◆ completeSync()
| void EthereumCapability::completeSync |
( |
| ) |
|
◆ db()
| OverlayDB const& dev::eth::EthereumCapability::db |
( |
| ) |
const |
|
inline |
◆ descriptor()
| p2p::CapDesc dev::eth::EthereumCapability::descriptor |
( |
| ) |
const |
|
inlineoverride |
◆ disablePeer()
| void EthereumCapability::disablePeer |
( |
NodeID const & |
_peerID, |
|
|
std::string const & |
_problem |
|
) |
| |
◆ doBackgroundWork()
| void EthereumCapability::doBackgroundWork |
( |
| ) |
|
|
override |
Main work loop - sends new transactions and blocks to available peers and disconnects from timed out peers
Definition at line 852 of file EthereumCapability.cpp.
◆ interpretCapabilityPacket()
| bool EthereumCapability::interpretCapabilityPacket |
( |
NodeID const & |
_peerID, |
|
|
unsigned |
_id, |
|
|
RLP const & |
_r |
|
) |
| |
|
override |
Packet layout: [ block: { P , B_32 }, maxHeaders: P, skip: P, reverse: P in { 0 , 1 } ]
Definition at line 642 of file EthereumCapability.cpp.
◆ isSyncing()
| bool EthereumCapability::isSyncing |
( |
| ) |
const |
◆ messageCount()
| unsigned dev::eth::EthereumCapability::messageCount |
( |
| ) |
const |
|
inlineoverride |
◆ name()
| std::string dev::eth::EthereumCapability::name |
( |
| ) |
const |
|
inlineoverride |
◆ networkId()
| u256 dev::eth::EthereumCapability::networkId |
( |
| ) |
const |
|
inline |
◆ noteNewBlocks()
| void dev::eth::EthereumCapability::noteNewBlocks |
( |
| ) |
|
|
inline |
◆ noteNewTransactions()
| void dev::eth::EthereumCapability::noteNewTransactions |
( |
| ) |
|
|
inline |
◆ onBlockImported()
| void dev::eth::EthereumCapability::onBlockImported |
( |
BlockHeader const & |
_info | ) |
|
|
inline |
◆ onConnect()
| void EthereumCapability::onConnect |
( |
NodeID const & |
_nodeID, |
|
|
u256 const & |
_peerCapabilityVersion |
|
) |
| |
|
override |
◆ onDisconnect()
| void EthereumCapability::onDisconnect |
( |
NodeID const & |
_nodeID | ) |
|
|
override |
◆ peer() [1/2]
◆ peer() [2/2]
◆ protocolVersion()
| unsigned dev::eth::EthereumCapability::protocolVersion |
( |
| ) |
const |
|
inline |
◆ reset()
| void EthereumCapability::reset |
( |
| ) |
|
◆ setNetworkId()
| void dev::eth::EthereumCapability::setNetworkId |
( |
u256 |
_n | ) |
|
|
inline |
◆ stateName()
| static char const* dev::eth::EthereumCapability::stateName |
( |
SyncState |
_s | ) |
|
|
inlinestatic |
◆ status()
◆ version()
| unsigned dev::eth::EthereumCapability::version |
( |
| ) |
const |
|
inlineoverride |
◆ c_oldProtocolVersion
| unsigned const dev::eth::EthereumCapability::c_oldProtocolVersion |
|
static |
The documentation for this class was generated from the following files: