diff --git a/synced-pool.go b/synced-pool.go index b8b5914..07f60ff 100644 --- a/synced-pool.go +++ b/synced-pool.go @@ -465,7 +465,14 @@ func (p *SyncedPool) getGrainPool(id CartId) (GrainPool, error) { p.mu.RLock() remotePool, ok := p.remoteIndex[id] p.mu.RUnlock() - if ok && remotePool != nil { + if ok { + if remotePool == nil { + p.mu.Lock() + delete(p.remoteIndex, id) + p.mu.Unlock() + return nil, fmt.Errorf("remote pool is nil", id) + + } remoteLookupCount.Inc() return remotePool, nil }