From 79258591936d5c2599c1dae1222647c746645e27 Mon Sep 17 00:00:00 2001 From: zelig Date: Tue, 31 May 2016 19:42:13 +0200 Subject: [PATCH] syncer: fix process leak by adding select to state.synced <- false --- swarm/network/syncer.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/swarm/network/syncer.go b/swarm/network/syncer.go index e540e236f5..c6c51934e6 100644 --- a/swarm/network/syncer.go +++ b/swarm/network/syncer.go @@ -477,7 +477,11 @@ LOOP: // history channel is closed, waiting for new state (called from sync()) syncStates = self.syncStates state.Synced = true // this signals that the current segment is complete - state.synced <- false + select { + case state.synced <- false: + case <-self.quit: + break LOOP + } justSynced = true history = nil }