diff options
author | Wei-Ning Huang <w@cobinhood.com> | 2018-10-12 13:01:15 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2018-12-19 20:54:27 +0800 |
commit | 32fea933fb8546286f4591a62aa9700e396e4d24 (patch) | |
tree | 0a8dd18c5c5ae1041c8bc9ede1d96d71e97836ef /dex/backend.go | |
parent | 43d1d9f257f17efa3000ae3ad80585c7b33d91ac (diff) | |
download | dexon-32fea933fb8546286f4591a62aa9700e396e4d24.tar dexon-32fea933fb8546286f4591a62aa9700e396e4d24.tar.gz dexon-32fea933fb8546286f4591a62aa9700e396e4d24.tar.bz2 dexon-32fea933fb8546286f4591a62aa9700e396e4d24.tar.lz dexon-32fea933fb8546286f4591a62aa9700e396e4d24.tar.xz dexon-32fea933fb8546286f4591a62aa9700e396e4d24.tar.zst dexon-32fea933fb8546286f4591a62aa9700e396e4d24.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 405359a6c..d1e5ecba2 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 } |