OSDN Git Service

add_comment_for_bbft (#502)
[bytom/vapor.git] / protocol / bbft.go
index fa58664..c1b63a2 100644 (file)
@@ -6,13 +6,13 @@ import (
 
        log "github.com/sirupsen/logrus"
 
-       "github.com/vapor/config"
-       "github.com/vapor/crypto/ed25519/chainkd"
-       "github.com/vapor/errors"
-       "github.com/vapor/event"
-       "github.com/vapor/protocol/bc"
-       "github.com/vapor/protocol/bc/types"
-       "github.com/vapor/protocol/state"
+       "github.com/bytom/vapor/config"
+       "github.com/bytom/vapor/crypto/ed25519/chainkd"
+       "github.com/bytom/vapor/errors"
+       "github.com/bytom/vapor/event"
+       "github.com/bytom/vapor/protocol/bc"
+       "github.com/bytom/vapor/protocol/bc/types"
+       "github.com/bytom/vapor/protocol/state"
 )
 
 const (
@@ -227,13 +227,16 @@ func (c *Chain) signBlockHeader(blockHeader *types.BlockHeader) ([]byte, error)
        xprv := config.CommonConfig.PrivateKey()
        xpub := xprv.XPub()
        node, err := c.getConsensusNode(&blockHeader.PreviousBlockHash, xpub.String())
+       blockHash := blockHeader.Hash().String()
        if err == errNotFoundConsensusNode {
+               log.WithFields(log.Fields{"module": logModule, "blockHash": blockHash}).Warn("can't find consensus node of current node")
                return nil, nil
        } else if err != nil {
                return nil, err
        }
 
        if err := c.checkDoubleSign(blockHeader, node.XPub.String()); err == errDoubleSignBlock {
+               log.WithFields(log.Fields{"module": logModule, "blockHash": blockHash}).Warn("current node has double sign the block")
                return nil, nil
        } else if err != nil {
                return nil, err