OSDN Git Service

Add confirm tx
[bytom/vapor.git] / protocol / protocol.go
index 45cefc8..7bd8518 100644 (file)
@@ -6,6 +6,7 @@ import (
        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"
@@ -22,10 +23,9 @@ type Chain struct {
        store          Store
        processBlockCh chan *processBlockMsg
 
-       cond       sync.Cond
-       bestNode   *state.BlockNode
-       Authoritys map[string]string
-       position   uint64
+       cond     sync.Cond
+       bestNode *state.BlockNode
+       engine   engine.Engine
 }
 
 // NewChain returns a new Chain using store as the underlying storage.
@@ -57,12 +57,8 @@ func NewChain(store Store, txPool *TxPool) (*Chain, error) {
        return c, nil
 }
 
-func (c *Chain) SetAuthoritys(authoritys map[string]string) {
-       c.Authoritys = authoritys
-}
-
-func (c *Chain) SetPosition(position uint64) {
-       c.position = position
+func (c *Chain) SetConsensusEngine(engine engine.Engine) {
+       c.engine = engine
 }
 
 func (c *Chain) initChainStatus() error {