Documentation ¶
Index ¶
Constants ¶
View Source
const ( BlockHashLeastNeighborNumber = 2 BlockHashExpiredSeconds = 60 BlockHashMaxRequestRange = 100 )
Constant of blockhash sync
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sync ¶
type Sync struct {
// contains filtered or unexported fields
}
Sync is the synchronizer of blockchain. It includes requestHandler, heightSync, blockhashSync, blockSync.
func New ¶
func New(p p2p.Service, bCache blockcache.BlockCache, bChain block.Chain) *Sync
New will return a new synchronizer of blockchain.
func (*Sync) BroadcastBlockInfo ¶
BroadcastBlockInfo will broadcast new block information to neighbor nodes.
func (*Sync) IncomingBlock ¶
IncomingBlock will return the blocks from other nodes. Including passive request and active broadcast.
func (*Sync) IsCatchingUp ¶
IsCatchingUp will return whether it is catching up with other nodes.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.