From 2f4996a9b2abefd1741a096660f08ab1cf44cbb8 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Wed, 18 May 2022 20:02:05 +0200 Subject: [PATCH] ethdb/remotedb: fix flawed check in Has/HasAncient --- ethdb/remotedb/remotedb.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ethdb/remotedb/remotedb.go b/ethdb/remotedb/remotedb.go index a645760b9..59a570bb5 100644 --- a/ethdb/remotedb/remotedb.go +++ b/ethdb/remotedb/remotedb.go @@ -37,9 +37,9 @@ type Database struct { func (db *Database) Has(key []byte) (bool, error) { if _, err := db.Get(key); err != nil { - return true, nil + return false, nil } - return false, nil + return true, nil } func (db *Database) Get(key []byte) ([]byte, error) { @@ -53,9 +53,9 @@ func (db *Database) Get(key []byte) ([]byte, error) { func (db *Database) HasAncient(kind string, number uint64) (bool, error) { if _, err := db.Ancient(kind, number); err != nil { - return true, nil + return false, nil } - return false, nil + return true, nil } func (db *Database) Ancient(kind string, number uint64) ([]byte, error) {