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

Method getEndorsedProposal

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

Source from the content-addressed store, hash-verified

194}
195
196func (pool *BlockPool) getEndorsedProposal(blkNum uint32) (*blockProposalMsg, bool) {
197 if !pool.endorsedForBlock(blkNum) {
198 return nil, false
199 }
200
201 pool.lock.RLock()
202 defer pool.lock.RUnlock()
203
204 c := pool.candidateBlocks[blkNum]
205 if c == nil {
206 return nil, false
207 }
208
209 if c.EndorsedEmptyProposal != nil {
210 return c.EndorsedEmptyProposal, true
211 } else if c.EndorsedProposal != nil {
212 return c.EndorsedProposal, false
213 }
214
215 return nil, false
216}
217
218func (pool *BlockPool) endorsedForEmptyBlock(blkNum uint32) bool {
219 pool.lock.RLock()

Callers 1

actionLoopMethod · 0.80

Calls 1

endorsedForBlockMethod · 0.95

Tested by

no test coverage detected