diff --git a/VERSION b/VERSION index 731d500dc..22a3057d2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.56.8 +0.56.9 diff --git a/services/wallet/service.go b/services/wallet/service.go index 2ae71d65f..2c8e33104 100644 --- a/services/wallet/service.go +++ b/services/wallet/service.go @@ -32,6 +32,7 @@ type Service struct { reactor *Reactor signals *SignalsTransmitter client *ethclient.Client + started bool group *Group accountsFeed *event.Feed @@ -55,6 +56,7 @@ func (s *Service) StartReactor(client *ethclient.Client, accounts []common.Addre s.group.Add(func(ctx context.Context) error { return WatchAccountsChanges(ctx, s.accountsFeed, accounts, reactor) }) + s.started = true return nil } @@ -68,6 +70,7 @@ func (s *Service) StopReactor() error { s.group.Stop() s.group.Wait() } + s.started = false return nil } @@ -153,5 +156,5 @@ func mapToList(m map[common.Address]struct{}) []common.Address { } func (s *Service) IsStarted() bool { - return s.group != nil + return s.started } diff --git a/services/wallet/transmitter.go b/services/wallet/transmitter.go index 14d99b9b5..d31d34069 100644 --- a/services/wallet/transmitter.go +++ b/services/wallet/transmitter.go @@ -24,7 +24,8 @@ type SignalsTransmitter struct { // Start runs loop in background. func (tmr *SignalsTransmitter) Start() error { if tmr.quit != nil { - return errAlreadyRunning + // already running, nothing to do + return nil } tmr.quit = make(chan struct{}) events := make(chan Event, 10)