X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=protocol%2Fprotocol.go;fp=protocol%2Fprotocol.go;h=f3f4fc262b4f6fb7e0bdf3f843c64268447931b8;hb=04e99309457c70c11b0538e38b6a0b68d5b64a87;hp=2ad9d6e427f54028393f4e6c648e2af19abf8e14;hpb=d5fbf5bf9d26847b1e884c76337077f32db86b7f;p=bytom%2Fvapor.git diff --git a/protocol/protocol.go b/protocol/protocol.go index 2ad9d6e4..f3f4fc26 100644 --- a/protocol/protocol.go +++ b/protocol/protocol.go @@ -6,6 +6,7 @@ import ( log "github.com/sirupsen/logrus" "github.com/vapor/config" + "github.com/vapor/event" "github.com/vapor/protocol/bc" "github.com/vapor/protocol/bc/types" "github.com/vapor/protocol/state" @@ -28,7 +29,7 @@ type Chain struct { } // NewChain returns a new Chain using store as the underlying storage. -func NewChain(store Store, txPool *TxPool) (*Chain, error) { +func NewChain(store Store, txPool *TxPool, eventDispatcher *event.Dispatcher) (*Chain, error) { c := &Chain{ orphanManage: NewOrphanManage(), txPool: txPool, @@ -52,7 +53,7 @@ func NewChain(store Store, txPool *TxPool) (*Chain, error) { c.bestNode = c.index.GetNode(storeStatus.Hash) c.index.SetMainChain(c.bestNode) - c.bbft = newBbft(store, c.index, c.orphanManage) + c.bbft = newBbft(store, c.index, c.orphanManage, eventDispatcher) go c.blockProcesser() return c, nil }