mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-25 13:47:19 +00:00
cli: reload state root service on USR1
It's a bit special since it's _always_ present to catch stateroots from the network.
This commit is contained in:
parent
9341bb6628
commit
bf92966633
2 changed files with 12 additions and 0 deletions
|
@ -588,6 +588,17 @@ Main:
|
|||
if p2pNotary != nil && serv.IsInSync() {
|
||||
p2pNotary.Start()
|
||||
}
|
||||
srMod.SetUpdateValidatorsCallback(nil)
|
||||
sr.Shutdown()
|
||||
sr, err = stateroot.New(cfgnew.ApplicationConfiguration.StateRoot, srMod, log, chain, serv.BroadcastExtensible)
|
||||
if err != nil {
|
||||
log.Error("failed to create state validation service", zap.Error(err))
|
||||
break // The show must go on.
|
||||
}
|
||||
serv.AddExtensibleService(sr, stateroot.Category, sr.OnPayload)
|
||||
if serv.IsInSync() {
|
||||
sr.Start()
|
||||
}
|
||||
}
|
||||
cfg = cfgnew
|
||||
case <-grace.Done():
|
||||
|
|
|
@ -71,6 +71,7 @@ func (s *service) Shutdown() {
|
|||
if !s.started.CAS(true, false) {
|
||||
return
|
||||
}
|
||||
s.log.Info("stopping state validation service")
|
||||
close(s.stopCh)
|
||||
<-s.done
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue