log "github.com/sirupsen/logrus"
"github.com/vapor/config"
- engine "github.com/vapor/consensus/consensus"
"github.com/vapor/errors"
"github.com/vapor/protocol/bc"
"github.com/vapor/protocol/bc/types"
cond sync.Cond
bestNode *state.BlockNode
- engine engine.Engine
}
// NewChain returns a new Chain using store as the underlying storage.
return c, nil
}
-func (c *Chain) SetConsensusEngine(engine engine.Engine) {
- c.engine = engine
-}
-
func (c *Chain) initChainStatus() error {
genesisBlock := config.GenesisBlock()
txStatus := bc.NewTransactionStatus()
c.index.SetMainChain(node)
c.bestNode = node
- log.WithFields(log.Fields{"height": c.bestNode.Height, "hash": c.bestNode.Hash.String()}).Debug("chain best status has been update")
+ log.WithFields(log.Fields{"module": logModule, "height": c.bestNode.Height, "hash": c.bestNode.Hash.String()}).Debug("chain best status has been update")
c.cond.Broadcast()
return nil
}