MCPcopy Create free account
hub / github.com/DNAProject/DNA / committedForBlock

Method committedForBlock

consensus/vbft/block_pool.go:401–416  ·  view source on GitHub ↗
(blockNum uint32)

Source from the content-addressed store, hash-verified

399}
400
401func (pool *BlockPool) committedForBlock(blockNum uint32) bool {
402 pool.lock.RLock()
403 defer pool.lock.RUnlock()
404
405 // check if has committed for the block
406 if pool.chainStore.GetChainedBlockNum() >= blockNum {
407 return true
408 }
409
410 c := pool.candidateBlocks[blockNum]
411 if c == nil {
412 return false
413 }
414
415 return c.CommittedProposal != nil || c.CommittedEmptyProposal != nil
416}
417
418func (pool *BlockPool) setProposalCommitted(proposal *blockProposalMsg, forEmpty bool) error {
419 pool.lock.Lock()

Callers 3

processMsgEventMethod · 0.80
processTimerEventMethod · 0.80
commitBlockMethod · 0.80

Calls 1

GetChainedBlockNumMethod · 0.80

Tested by

no test coverage detected