From aba94c86f48d34fa730656725d28ddc7de91eaf9 Mon Sep 17 00:00:00 2001 From: Paladz Date: Sat, 23 Nov 2019 10:33:10 +0800 Subject: [PATCH] fix the roll back dead lock (#446) --- protocol/protocol.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol/protocol.go b/protocol/protocol.go index b67194ad..2ce9a1e8 100644 --- a/protocol/protocol.go +++ b/protocol/protocol.go @@ -241,7 +241,7 @@ func (c *Chain) syncProtocolStatus(subProtocol Protocoler) error { protocolHeight, protocolHash = block.Height-1, &block.PreviousBlockHash } - for height := protocolHeight + 1; height <= c.BestBlockHeight(); height++ { + for height := protocolHeight + 1; height <= c.bestBlockHeader.Height; height++ { block, err := c.GetBlockByHeight(height) if err != nil { return errors.Wrap(err, subProtocol.Name(), "can't get block by height in chain") -- 2.11.0