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 --- node/service.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'node') diff --git a/node/service.go b/node/service.go index f72ac54..fca9d90 100644 --- a/node/service.go +++ b/node/service.go @@ -91,13 +91,17 @@ func (ctx *ServiceContext) ExtRPCEnabled() bool { return ctx.config.ExtRPCEnabled() } -func NewServiceContext(mux *event.TypeMux) ServiceContext { - return ServiceContext { - config: &Config{}, - services: make(map[reflect.Type]Service), - EventMux: mux, - AccountManager: nil, - } +func NewServiceContext(cfg *Config, mux *event.TypeMux) (ServiceContext, string, error) { + if cfg == nil { + cfg = &Config{} + } + am, ep, err := makeAccountManager(cfg) + return ServiceContext{ + config: cfg, + services: make(map[reflect.Type]Service), + EventMux: mux, + AccountManager: am, + }, ep, err } // ServiceConstructor is the function signature of the constructors needed to be -- cgit v1.2.3-70-g09d2