From: Paladz Date: Sat, 23 Nov 2019 02:33:10 +0000 (+0800) Subject: fix the roll back dead lock (#446) X-Git-Tag: v1.0.5~13 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=aba94c86f48d34fa730656725d28ddc7de91eaf9;p=bytom%2Fvapor.git fix the roll back dead lock (#446) --- 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")