cache: Avoid unlikely zero division. (#282)
This commit is contained in:
parent
c1ba46347e
commit
f9c4e03eaa
@ -7,6 +7,7 @@ package webapi
|
||||
import (
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"errors"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@ -78,6 +79,10 @@ func updateCache(ctx context.Context, db *database.VspDatabase,
|
||||
return err
|
||||
}
|
||||
|
||||
if bestBlock.PoolSize == 0 {
|
||||
return errors.New("dcr node reports a network ticket pool size of zero")
|
||||
}
|
||||
|
||||
cacheMtx.Lock()
|
||||
defer cacheMtx.Unlock()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user