diff --git a/swarm/network/stream/stream.go b/swarm/network/stream/stream.go index 1eb082b124..1bc70fe763 100644 --- a/swarm/network/stream/stream.go +++ b/swarm/network/stream/stream.go @@ -95,7 +95,7 @@ type Registry struct { spec *protocols.Spec //this protocol's spec balance protocols.Balance //implements protocols.Balance, for accounting prices protocols.Prices //implements protocols.Prices, provides prices to accounting - close chan struct{} // terminates registry goroutines + quit chan struct{} // terminates registry goroutines } // RegistryOptions holds optional values for NewRegistry constructor. @@ -118,7 +118,7 @@ func NewRegistry(localID enode.ID, delivery *Delivery, syncChunkStore storage.Sy // check if retrieval has been disabled retrieval := options.Retrieval != RetrievalDisabled - closeChan := make(chan struct{}) + quit := make(chan struct{}) streamer := &Registry{ addr: localID, @@ -131,7 +131,7 @@ func NewRegistry(localID enode.ID, delivery *Delivery, syncChunkStore storage.Sy autoRetrieval: retrieval, maxPeerServers: options.MaxPeerServers, balance: balance, - close: closeChan, + quit: quit, } streamer.setupSpec() @@ -184,7 +184,7 @@ func NewRegistry(localID enode.ID, delivery *Delivery, syncChunkStore storage.Sy default: } out <- i - case <-closeChan: + case <-quit: return } } @@ -238,7 +238,7 @@ func NewRegistry(localID enode.ID, delivery *Delivery, syncChunkStore storage.Sy <-timer.C } timer.Reset(options.SyncUpdateDelay) - case <-closeChan: + case <-quit: break loop } } @@ -413,7 +413,7 @@ func (r *Registry) Close() error { // change from Kademlia that were initiated in NewRegistry constructor. r.delivery.kad.CloseNeighbourhoodDepthC() r.delivery.kad.CloseAddrCountC() - close(r.close) + close(r.quit) return r.intervalsStore.Close() }