mirror of
https://github.com/LBRYFoundation/reflector.go.git
synced 2025-08-23 17:27:25 +00:00
check blocklist first, its cheaper
This commit is contained in:
parent
c3ab5dd2a5
commit
c7643fb5da
1 changed files with 4 additions and 4 deletions
|
@ -107,13 +107,13 @@ func (d *DBBackedS3Store) Block(hash string) error {
|
|||
|
||||
// Wants returns false if the hash exists or is blocked, true otherwise
|
||||
func (d *DBBackedS3Store) Wants(hash string) (bool, error) {
|
||||
has, err := d.Has(hash)
|
||||
if has || err != nil {
|
||||
blocked, err := d.isBlocked(hash)
|
||||
if blocked || err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
blocked, err := d.isBlocked(hash)
|
||||
return !blocked, err
|
||||
has, err := d.Has(hash)
|
||||
return !has, err
|
||||
}
|
||||
|
||||
// MissingBlobsForKnownStream returns missing blobs for an existing stream
|
||||
|
|
Loading…
Add table
Reference in a new issue