aboutsummaryrefslogtreecommitdiff
path: root/node/service.go
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-09-24 12:55:57 -0400
committerDeterminant <[email protected]>2019-09-24 12:55:57 -0400
commitfc9229d7d25dafe2eb37965115888d17e473ebe4 (patch)
tree251fde169b5f35dbbf27e720b98393e3a8165634 /node/service.go
parent215fec775fc457fb69d77fd0fc128893721fa34e (diff)
enable AccountManager; add a channel to notify new txs
Diffstat (limited to 'node/service.go')
-rw-r--r--node/service.go18
1 files changed, 11 insertions, 7 deletions
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