Skip to content

Commit

Permalink
op-node/p2p: Fix deleteRecord to return nil if store.Delete succeeds
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianst committed Nov 21, 2023
1 parent 2e35a8f commit 7ffa3f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion op-node/p2p/store/records_book.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7ffa3f7

Please sign in to comment.