From 98d71cb5ec7e3d343488607db8047b4cd80be9cf Mon Sep 17 00:00:00 2001 From: Jimmy Hu Date: Mon, 18 Mar 2019 11:04:48 +0800 Subject: core: fix 'failed to pre process block' message if unknown block is confirmed (#495) --- core/agreement.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/agreement.go b/core/agreement.go index 43fddd0..b0c7734 100644 --- a/core/agreement.go +++ b/core/agreement.go @@ -533,6 +533,10 @@ func (a *agreement) done() <-chan struct{} { func (a *agreement) confirmed() bool { a.lock.RLock() defer a.lock.RUnlock() + return a.confirmedNoLock() +} + +func (a *agreement) confirmedNoLock() bool { return a.hasOutput } @@ -556,6 +560,8 @@ func (a *agreement) processBlock(block *types.Block) error { receivedTime: time.Now().UTC(), }) return nil + } else if a.confirmedNoLock() { + return nil } if b, exist := a.data.blocks[block.ProposerID]; exist { if b.Hash != block.Hash { -- cgit v1.2.3