From 0dd1ed4670392db36c491ff1cce5f0b7ab686b13 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Tue, 17 Dec 2024 13:44:45 +0100 Subject: [PATCH] Fix error when no doublehash db exists This was introduced after the refactor here: db000150a308129ce0b43f061a56fb2bee8e547a. Before, we did not error when a double-hash db does not exist (meaning there are no entries in it). This goes back to that behaviour. --- denylist.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/denylist.go b/denylist.go index 6fc27b8..3c59cf4 100644 --- a/denylist.go +++ b/denylist.go @@ -620,7 +620,7 @@ func toDNSLinkFQDN(label string) string { func (dl *Denylist) checkDoubleHashWithFn(caller string, origKey string, code uint64) (Status, Entry, error) { blocksdb, ok := dl.DoubleHashBlocksDB[code] if !ok { - return StatusErrored, Entry{}, fmt.Errorf("no DoubleHashBlocksDB for code %d", code) + return StatusNotFound, Entry{}, nil } // Double-hash the key doubleHash, err := multihash.Sum([]byte(origKey), code, -1)