From f3f0b274f2b8aad466b51448f2fbd2d2b8a4d1db Mon Sep 17 00:00:00 2001 From: Determinant Date: Thu, 26 Sep 2019 22:19:04 -0400 Subject: expose the database interface --- coreth.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'coreth.go') diff --git a/coreth.go b/coreth.go index 4bb0ae8..04d782f 100644 --- a/coreth.go +++ b/coreth.go @@ -14,6 +14,7 @@ import ( "github.com/ava-labs/go-ethereum/core/state" "github.com/ava-labs/go-ethereum/core/types" "github.com/ava-labs/go-ethereum/crypto" + "github.com/ava-labs/go-ethereum/ethdb" "github.com/ava-labs/go-ethereum/event" "github.com/ava-labs/go-ethereum/log" "github.com/ava-labs/go-ethereum/rpc" @@ -34,7 +35,7 @@ func isLocalBlock(block *types.Block) bool { return false } -func NewETHChain(config *eth.Config, nodecfg *node.Config, etherBase *common.Address) *ETHChain { +func NewETHChain(config *eth.Config, nodecfg *node.Config, etherBase *common.Address, chainDB ethdb.Database) *ETHChain { if config == nil { config = ð.DefaultConfig } @@ -47,11 +48,11 @@ func NewETHChain(config *eth.Config, nodecfg *node.Config, etherBase *common.Add panic(err) } if ep != "" { - log.Info(fmt.Sprintf("ephemeral = %s", ep)) + log.Info(fmt.Sprintf("temporary keystore = %s", ep)) } cb := new(dummy.ConsensusCallbacks) mcb := new(miner.MinerCallbacks) - backend, _ := eth.New(&ctx, config, cb, mcb) + backend, _ := eth.New(&ctx, config, cb, mcb, chainDB) chain := ÐChain{backend: backend, cb: cb, mcb: mcb} if etherBase == nil { etherBase = &common.Address{ -- cgit v1.2.3