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

Method endorsedForBlock

consensus/vbft/block_pool.go:178–194  ·  view source on GitHub ↗
(blkNum uint32)

Source from the content-addressed store, hash-verified

176}
177
178func (pool *BlockPool) endorsedForBlock(blkNum uint32) bool {
179 pool.lock.RLock()
180 defer pool.lock.RUnlock()
181
182 // check if has committed for the block
183 if pool.chainStore.GetChainedBlockNum() >= blkNum {
184 return true
185 }
186
187 // check if had endorsed for some proposal
188 c := pool.candidateBlocks[blkNum]
189 if c == nil {
190 return false
191 }
192
193 return c.EndorsedProposal != nil || c.EndorsedEmptyProposal != nil
194}
195
196func (pool *BlockPool) getEndorsedProposal(blkNum uint32) (*blockProposalMsg, bool) {
197 if !pool.endorsedForBlock(blkNum) {

Callers 4

getEndorsedProposalMethod · 0.95
processTimerEventMethod · 0.80
endorseBlockMethod · 0.80
handleProposalTimeoutMethod · 0.80

Calls 1

GetChainedBlockNumMethod · 0.80

Tested by

no test coverage detected