OSDN Git Service

fix the roll back dead lock (#446)
authorPaladz <yzhu101@uottawa.ca>
Sat, 23 Nov 2019 02:33:10 +0000 (10:33 +0800)
committerGitHub <noreply@github.com>
Sat, 23 Nov 2019 02:33:10 +0000 (10:33 +0800)
protocol/protocol.go

index b67194a..2ce9a1e 100644 (file)
@@ -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")