aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/dexon-foundation/dexon-consensus-core/core/compaction-chain.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus-core/core/compaction-chain.go')
-rw-r--r--vendor/github.com/dexon-foundation/dexon-consensus-core/core/compaction-chain.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus-core/core/compaction-chain.go b/vendor/github.com/dexon-foundation/dexon-consensus-core/core/compaction-chain.go
index 5b13f7fe1..451cb1355 100644
--- a/vendor/github.com/dexon-foundation/dexon-consensus-core/core/compaction-chain.go
+++ b/vendor/github.com/dexon-foundation/dexon-consensus-core/core/compaction-chain.go
@@ -132,6 +132,7 @@ func (cc *compactionChain) extractBlocks() []*types.Block {
cc.pendingBlocks = cc.pendingBlocks[1:]
block := cc.pendingBlocks[0]
+ block.Finalization.ParentHash = prevBlock.Hash
block.Finalization.Height = prevBlock.Finalization.Height + 1
deliveringBlocks = append(deliveringBlocks, block)
prevBlock = block
@@ -204,8 +205,7 @@ func (cc *compactionChain) extractFinalizedBlocks() []*types.Block {
continue
}
// Fork resolution: choose block with smaller hash.
- if prevBlock.Finalization.Height ==
- b.Finalization.Height {
+ if prevBlock.Finalization.Height == b.Finalization.Height {
//TODO(jimmy-dexon): remove this panic after test.
if true {
// workaround to `go vet` error