![]() |
Ethereum
PoC-8
The C++ Implementation of Ethereum
|
Base BlockChain synchronization strategy class. Syncs to peers and keeps up to date. Base class handles blocks downloading but does not contain any details on state transfer logic. More...
#include <BlockChainSync.h>
Public Member Functions | |
| BlockChainSync (EthereumCapability &_host) | |
| ~BlockChainSync () | |
| void | abortSync () |
| Abort all sync activity. More... | |
| bool | isSyncing () const |
| void | restartSync () |
| Restart sync. More... | |
| void | completeSync () |
| void | onPeerStatus (EthereumPeer const &_peer) |
| Called by peer to report status. More... | |
| void | onPeerBlockHeaders (NodeID const &_peerID, RLP const &_r) |
| Called by peer once it has new block headers during sync. More... | |
| void | onPeerBlockBodies (NodeID const &_peerID, RLP const &_r) |
| Called by peer once it has new block bodies. More... | |
| void | onPeerNewBlock (NodeID const &_peerID, RLP const &_r) |
| Called by peer once it has new block bodies. More... | |
| void | onPeerNewHashes (NodeID const &_peerID, std::vector< std::pair< h256, u256 >> const &_hashes) |
| void | onPeerAborting () |
| Called by peer when it is disconnecting. More... | |
| void | onBlockImported (BlockHeader const &_info) |
| Called when a blockchain has imported a new block onto the DB. More... | |
| SyncStatus | status () const |
Static Public Member Functions | |
| static char const * | stateName (SyncState _s) |
Base BlockChain synchronization strategy class. Syncs to peers and keeps up to date. Base class handles blocks downloading but does not contain any details on state transfer logic.
Definition at line 31 of file BlockChainSync.h.
|
explicit |
Definition at line 140 of file BlockChainSync.cpp.
| BlockChainSync::~BlockChainSync | ( | ) |
Definition at line 155 of file BlockChainSync.cpp.
| void BlockChainSync::abortSync | ( | ) |
Abort all sync activity.
Definition at line 174 of file BlockChainSync.cpp.
| void BlockChainSync::completeSync | ( | ) |
Called after all blocks have been downloaded Public only for test mode
Definition at line 851 of file BlockChainSync.cpp.
| bool BlockChainSync::isSyncing | ( | ) | const |
Definition at line 863 of file BlockChainSync.cpp.
| void BlockChainSync::onBlockImported | ( | BlockHeader const & | _info | ) |
Called when a blockchain has imported a new block onto the DB.
Definition at line 161 of file BlockChainSync.cpp.
| void BlockChainSync::onPeerAborting | ( | ) |
Called by peer when it is disconnecting.
Definition at line 917 of file BlockChainSync.cpp.
Called by peer once it has new block bodies.
Definition at line 574 of file BlockChainSync.cpp.
Called by peer once it has new block headers during sync.
Definition at line 430 of file BlockChainSync.cpp.
Called by peer once it has new block bodies.
Definition at line 728 of file BlockChainSync.cpp.
| void BlockChainSync::onPeerNewHashes | ( | NodeID const & | _peerID, |
| std::vector< std::pair< h256, u256 >> const & | _hashes | ||
| ) |
Definition at line 868 of file BlockChainSync.cpp.
| void BlockChainSync::onPeerStatus | ( | EthereumPeer const & | _peer | ) |
Called by peer to report status.
Definition at line 181 of file BlockChainSync.cpp.
| void BlockChainSync::restartSync | ( | ) |
Restart sync.
Definition at line 839 of file BlockChainSync.cpp.
|
inlinestatic |
Definition at line 71 of file BlockChainSync.h.
| SyncStatus BlockChainSync::status | ( | ) | const |
Definition at line 814 of file BlockChainSync.cpp.