diff --git a/cache/nodes.go b/cache/nodes.go index 7586e97..eb2d00d 100644 --- a/cache/nodes.go +++ b/cache/nodes.go @@ -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() {