diff options
author | Wei-Ning Huang <w@cobinhood.com> | 2018-10-12 13:01:15 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-03-12 12:19:09 +0800 |
commit | 085aac156c7bc415466bd11a3e75eb546ac35466 (patch) | |
tree | 94ab15c68c839a3929af9c39d6aaed7bf3191d00 /dex/backend.go | |
parent | ba01972f09a63ad5bfbb81367be907b89e1b5102 (diff) | |
download | dexon-085aac156c7bc415466bd11a3e75eb546ac35466.tar.gz dexon-085aac156c7bc415466bd11a3e75eb546ac35466.tar.zst dexon-085aac156c7bc415466bd11a3e75eb546ac35466.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 } |