OSDN Git Service

fix the roll back dead lock fix_lock
authorpaladz <453256728@qq.com>
Fri, 22 Nov 2019 10:59:51 +0000 (18:59 +0800)
committerpaladz <453256728@qq.com>
Fri, 22 Nov 2019 10:59:51 +0000 (18:59 +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")