fix closing of nodes iter channel
parent
129799328d
commit
d7806c6cfd
|
@ -89,7 +89,7 @@ func (p *NodesCache) Iter() chan *element.Node {
|
|||
// we need to Close the iter before closing the
|
||||
// chan (and thus signaling that we are done)
|
||||
// to avoid race where db is closed before the iterator
|
||||
close(nodes)
|
||||
defer close(nodes)
|
||||
defer it.Close()
|
||||
it.SeekToFirst()
|
||||
for ; it.Valid(); it.Next() {
|
||||
|
|
Loading…
Reference in New Issue