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

Method getChainedBlock

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

Source from the content-addressed store, hash-verified

713}
714
715func (pool *BlockPool) getChainedBlock(blockNum uint32) (*Block, common.Uint256) {
716 pool.lock.RLock()
717 defer pool.lock.RUnlock()
718
719 // get from chainstore
720 blk, err := pool.chainStore.getBlock(blockNum)
721 if err != nil {
722 log.Errorf("getSealedBlock %d err:%v", blockNum, err)
723 return nil, common.Uint256{}
724 }
725 return blk, blk.Block.Hash()
726}
727
728func (pool *BlockPool) findConsensusEmptyProposal(blockNum uint32) (*blockProposalMsg, error) {
729 pool.lock.RLock()

Callers 1

onConsensusMsgMethod · 0.80

Calls 3

ErrorfFunction · 0.92
HashMethod · 0.65
getBlockMethod · 0.45

Tested by

no test coverage detected