Documentation ¶
Index ¶
Constants ¶
View Source
const ( TIMER_FAST_SYNC_LAST_BLOCK_NUMBER = 2 TIMER_NORMAL_SYNC_LAST_BLOCK_NUMBER = 4 TIMER_CHECK_SYNC_LAST_BLOCK_NUMBER = 20 TIMER_SYNC_STATE_CHECK = 5 TIMER_SYNC_STATE_CHECK1 = 1 TIMER_HEADER_SYNC = 2 TIMER_BLOCK_SYNC = 2 TIMER_CATCHUP = 2 CATCHUP_COUNTER = 10 TIMER_HEADER_UPDATE_CHECK = 1 SYNC_BLOCK_BUNDLE = 60 SYNC_BLOCK_BUNDLE_MAX = 200 SYNC_HEADER_BUNDLE = 3 )
DO NOT EDIT
View Source
const ( STATE_SYNCING = 0 STATE_CATCHUP = 1 STATE_NORMAL = 2 )
DO NOT EDIT
View Source
const ( SET_SYNC_NULL = 0 SET_SYNC_HEADER = 1 SET_SYNC_BLOCK = 2 )
DO NOT EDIT
View Source
const ( CATCHUP_COMPLETE = 0 CATCHUP_DOING = 1 )
DO NOT EDIT
View Source
const ( BLOCK_REQ = 1 //BLOCK_INFO update or response BLOCK_UPDATE = 2 LAST_BLOCK_NUMBER_REQ = 3 LAST_BLOCK_NUMBER_RSP = 4 BLOCK_HEADER_REQ = 5 BLOCK_HEADER_RSP = 6 BLOCK_HEADER_UPDATE = 7 BLOCK_CATCH_REQUEST = 8 BLOCK_CATCH_RESPONSE = 9 )
DO NOT EDIT
View Source
const (
//WAIT_TIME wait for actors ready
WAIT_TIME = 20
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct { S *synchronizes // contains filtered or unexported fields }
Block sync block with peer and send up to block actor
func MakeBlock ¶
func MakeBlock(chain chain.BlockChainInterface, nodeType bool) *Block
MakeBlock new instance
func (*Block) GetSyncState ¶
GetSyncState get current synchronize status
func (*Block) SendNewBlock ¶
func (b *Block) SendNewBlock(notify *message.NotifyBlock)
SendNewBlock send out a new block
func (*Block) UpdateHeadNumber ¶
func (b *Block) UpdateHeadNumber()
func (*Block) UpdateNumber ¶
func (b *Block) UpdateNumber()
Click to show internal directories.
Click to hide internal directories.