]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/cypherpunks.ru/nncp/sp.go
Stop goroutine when state is dead
[nncp.git] / src / cypherpunks.ru / nncp / sp.go
index fdfb14ab538a0ada1c501de3c8d246dbd92ab99c..e309b982f487903bef518fcbb25992da55666dcc 100644 (file)
@@ -546,6 +546,9 @@ func (state *SPState) StartWorkers(
        if state.xxOnly == "" || state.xxOnly == TTx {
                go func() {
                        for range time.Tick(time.Second) {
+                               if state.NotAlive() {
+                                       return
+                               }
                                for _, payload := range state.ctx.infosOur(
                                        state.Node.Id,
                                        state.nice,