diff options
author | Wei-Ning Huang <w@cobinhood.com> | 2018-10-12 13:01:15 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:49 +0800 |
commit | efa16f95fce18659532cf650e4ce0b46ec9f9245 (patch) | |
tree | 8deaf1be29c0a3d839940f1cde1c7409953397a5 /dex/backend.go | |
parent | 47b4be274b72cecfd653702413d4cae0f97f710e (diff) | |
download | dexon-efa16f95fce18659532cf650e4ce0b46ec9f9245.tar.gz dexon-efa16f95fce18659532cf650e4ce0b46ec9f9245.tar.zst dexon-efa16f95fce18659532cf650e4ce0b46ec9f9245.zip |
dex: add api_backend.go and it's dependencies
Diffstat (limited to 'dex/backend.go')
-rw-r--r-- | dex/backend.go | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/dex/backend.go b/dex/backend.go index b74636de4..3b7fde400 100644 --- a/dex/backend.go +++ b/dex/backend.go @@ -48,8 +48,11 @@ type Dexon struct { // Channel for shutting down the service shutdownChan chan bool // Channel for shutting down the Ethereum - txPool *core.TxPool - blockchain *core.BlockChain + + // Handlers + txPool *core.TxPool + blockchain *core.BlockChain + protocolManager *ProtocolManager // DB interfaces chainDb ethdb.Database // Block chain database @@ -176,3 +179,11 @@ func CreateDB(ctx *node.ServiceContext, config *Config, name string) (ethdb.Data } return db, nil } + +func (d *Dexon) AccountManager() *accounts.Manager { return d.accountManager } +func (d *Dexon) BlockChain() *core.BlockChain { return d.blockchain } +func (d *Dexon) TxPool() *core.TxPool { return d.txPool } +func (d *Dexon) DexVersion() int { return int(d.protocolManager.SubProtocols[0].Version) } +func (d *Dexon) EventMux() *event.TypeMux { return d.eventMux } +func (d *Dexon) Engine() consensus.Engine { return d.engine } +func (d *Dexon) ChainDb() ethdb.Database { return d.chainDb } |