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
|
// we need to Close the iter before closing the
|
||||||
// chan (and thus signaling that we are done)
|
// chan (and thus signaling that we are done)
|
||||||
// to avoid race where db is closed before the iterator
|
// to avoid race where db is closed before the iterator
|
||||||
close(nodes)
|
defer close(nodes)
|
||||||
defer it.Close()
|
defer it.Close()
|
||||||
it.SeekToFirst()
|
it.SeekToFirst()
|
||||||
for ; it.Valid(); it.Next() {
|
for ; it.Valid(); it.Next() {
|
||||||
|
|
Loading…
Reference in New Issue