OSDN Git Service

fix dead lock
authorshenao78 <shenao.78@163.com>
Wed, 30 Oct 2019 07:37:46 +0000 (15:37 +0800)
committershenao78 <shenao.78@163.com>
Wed, 30 Oct 2019 07:37:46 +0000 (15:37 +0800)
protocol/protocol.go

index 8dfd659..59880a7 100644 (file)
@@ -212,7 +212,7 @@ func (c *Chain) syncProtocolStatus(subProtocol Protocoler) error {
                return errors.Wrap(err, "failed on get sub protocol status")
        }
 
-       if protocolHeight == c.BestBlockHeight() && protocolHash == c.BestBlockHash() {
+       if protocolHeight == c.bestBlockHeader.Height && *protocolHash == c.bestBlockHeader.Hash() {
                return nil
        }