(blkNum uint32)
| 176 | } |
| 177 | |
| 178 | func (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 | |
| 196 | func (pool *BlockPool) getEndorsedProposal(blkNum uint32) (*blockProposalMsg, bool) { |
| 197 | if !pool.endorsedForBlock(blkNum) { |
no test coverage detected