aboutsummaryrefslogtreecommitdiffstats
path: root/dex/backend.go
diff options
context:
space:
mode:
Diffstat (limited to 'dex/backend.go')
-rw-r--r--dex/backend.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/dex/backend.go b/dex/backend.go
index 7a23ba80b..2f6d8a8e5 100644
--- a/dex/backend.go
+++ b/dex/backend.go
@@ -110,6 +110,8 @@ func New(ctx *node.ServiceContext, config *Config) (*Dexon, error) {
}
rawdb.WriteDatabaseVersion(chainDb, core.BlockChainVersion)
}
+ engine := dexcon.New()
+
dex := &Dexon{
config: config,
chainDb: chainDb,
@@ -121,7 +123,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Dexon, error) {
bloomRequests: make(chan chan *bloombits.Retrieval),
bloomIndexer: NewBloomIndexer(chainDb, params.BloomBitsBlocks, params.BloomConfirms),
blockdb: db,
- engine: dexcon.New(chainConfig.Dexcon),
+ engine: engine,
}
var (
@@ -154,9 +156,13 @@ func New(ctx *node.ServiceContext, config *Config) (*Dexon, error) {
}
dex.APIBackend.gpo = gasprice.NewOracle(dex.APIBackend, gpoParams)
+ // Dexcon related objects.
dex.governance = NewDexconGovernance(dex.APIBackend, dex.chainConfig, config.PrivateKey)
dex.app = NewDexconApp(dex.txPool, dex.blockchain, dex.governance, chainDb, config, vmConfig)
+ // Set config fetcher so engine can fetch current system configuration from state.
+ engine.SetConfigFetcher(dex.governance)
+
pm, err := NewProtocolManager(dex.chainConfig, config.SyncMode,
config.NetworkId, dex.eventMux, dex.txPool, dex.engine, dex.blockchain,
chainDb, dex.governance)