From fc9229d7d25dafe2eb37965115888d17e473ebe4 Mon Sep 17 00:00:00 2001 From: Determinant Date: Tue, 24 Sep 2019 12:55:57 -0400 Subject: enable AccountManager; add a channel to notify new txs --- coreth.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'coreth.go') diff --git a/coreth.go b/coreth.go index 0dbb226..3046b97 100644 --- a/coreth.go +++ b/coreth.go @@ -2,6 +2,7 @@ package coreth import ( "crypto/ecdsa" + "fmt" "io" "os" @@ -38,7 +39,13 @@ func NewETHChain(config *eth.Config, etherBase *common.Address) *ETHChain { config = ð.DefaultConfig } mux := new(event.TypeMux) - ctx := node.NewServiceContext(mux) + ctx, ep, err := node.NewServiceContext(nil, mux) + if err != nil { + panic(err) + } + if ep != "" { + log.Info(fmt.Sprintf("ephemeral = %s", ep)) + } cb := new(dummy.ConsensusCallbacks) mcb := new(miner.MinerCallbacks) backend, _ := eth.New(&ctx, config, cb, mcb) @@ -151,6 +158,10 @@ func (self *ETHChain) AttachEthService(handler *rpc.Server, namespaces []string) } } +func (self *ETHChain) GetTxSubmitCh() <-chan struct{} { + return self.backend.GetTxSubmitCh() +} + type Key struct { Address common.Address PrivateKey *ecdsa.PrivateKey -- cgit v1.2.3-70-g09d2