diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-10-15 10:33:17 +0800 |
---|---|---|
committer | Wei-Ning Huang <aitjcize@gmail.com> | 2018-10-15 10:33:17 +0800 |
commit | c636088a657b81b2baff6fa5cc72eaaeb2b817e2 (patch) | |
tree | 8e20c75cbd749118456c0ade8208b52ae3b401ef /core/compaction-chain.go | |
parent | 26bea95ae8a63e7bee4983e85d00a6ff6ca82f7c (diff) | |
download | dexon-consensus-c636088a657b81b2baff6fa5cc72eaaeb2b817e2.tar dexon-consensus-c636088a657b81b2baff6fa5cc72eaaeb2b817e2.tar.gz dexon-consensus-c636088a657b81b2baff6fa5cc72eaaeb2b817e2.tar.bz2 dexon-consensus-c636088a657b81b2baff6fa5cc72eaaeb2b817e2.tar.lz dexon-consensus-c636088a657b81b2baff6fa5cc72eaaeb2b817e2.tar.xz dexon-consensus-c636088a657b81b2baff6fa5cc72eaaeb2b817e2.tar.zst dexon-consensus-c636088a657b81b2baff6fa5cc72eaaeb2b817e2.zip |
core: No randomness for round 0 (#198)
* No randomness for round 0
* Ignore round 0 randomness
Diffstat (limited to 'core/compaction-chain.go')
-rw-r--r-- | core/compaction-chain.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/compaction-chain.go b/core/compaction-chain.go index c176f65..6803661 100644 --- a/core/compaction-chain.go +++ b/core/compaction-chain.go @@ -80,7 +80,8 @@ func (cc *compactionChain) extractBlocks() []*types.Block { cc.blocksLock.Lock() defer cc.blocksLock.Unlock() for len(cc.pendingBlocks) != 0 && - len(cc.pendingBlocks[0].Finalization.Randomness) != 0 { + (len(cc.pendingBlocks[0].Finalization.Randomness) != 0 || + cc.pendingBlocks[0].Position.Round == 0) { var block *types.Block block, cc.pendingBlocks = cc.pendingBlocks[0], cc.pendingBlocks[1:] delete(cc.blocks, block.Hash) |