From 52d490fa7e6b108f71ffb8937554141d5c668ff1 Mon Sep 17 00:00:00 2001 From: Jimmy Hu Date: Mon, 15 Oct 2018 11:17:59 +0800 Subject: core: fix simulation error (#201) * Sync dMoment for all consensus core * App check for randomness ignore round 0 --- simulation/app.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'simulation/app.go') diff --git a/simulation/app.go b/simulation/app.go index 0ca65c9..16bb63a 100644 --- a/simulation/app.go +++ b/simulation/app.go @@ -132,7 +132,14 @@ func (a *simApp) TotalOrderingDelivered(blockHashes common.Hashes, early bool) { // BlockDelivered is called when a block in compaction chain is delivered. func (a *simApp) BlockDelivered( blockHash common.Hash, result types.FinalizationResult) { - if len(result.Randomness) == 0 { + if len(result.Randomness) == 0 && func() bool { + if block, exist := a.blockByHash[blockHash]; exist { + if block.Position.Round == 0 { + return false + } + } + return true + }() { panic(fmt.Errorf("Block %s randomness is empty", blockHash)) } func() { -- cgit v1.2.3