diff options
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus/core/compaction-chain.go')
-rw-r--r-- | vendor/github.com/dexon-foundation/dexon-consensus/core/compaction-chain.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/compaction-chain.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/compaction-chain.go index 14e3b265d..8e044293f 100644 --- a/vendor/github.com/dexon-foundation/dexon-consensus/core/compaction-chain.go +++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/compaction-chain.go @@ -257,3 +257,15 @@ func (cc *compactionChain) lastPendingBlock() *types.Block { } return nil } + +func (cc *compactionChain) pendingBlocksWithoutRandomness() ( + hashes common.Hashes) { + cc.lock.RLock() + defer cc.lock.RUnlock() + for _, block := range cc.pendingBlocks { + if _, exist := cc.blockRandomness[block.Hash]; !exist { + hashes = append(hashes, block.Hash) + } + } + return +} |