From 7ffa3f7c3243d199e7c0a6552367f4c57b3bd1b0 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Mon, 20 Nov 2023 23:51:36 +0100 Subject: [PATCH] op-node/p2p: Fix deleteRecord to return nil if store.Delete succeeds --- op-node/p2p/store/records_book.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/op-node/p2p/store/records_book.go b/op-node/p2p/store/records_book.go index 67bb4706591a..9afac37abfbb 100644 --- a/op-node/p2p/store/records_book.go +++ b/op-node/p2p/store/records_book.go @@ -94,7 +94,7 @@ func (d *recordsBook[K, V]) dsKey(key K) ds.Key { func (d *recordsBook[K, V]) deleteRecord(key K) error { d.cache.Remove(key) err := d.store.Delete(d.ctx, d.dsKey(key)) - if errors.Is(err, ds.ErrNotFound) { + if err == nil || errors.Is(err, ds.ErrNotFound) { return nil } return fmt.Errorf("failed to delete entry with key %v: %w", key, err)