Skip to content

Commit

Permalink
ethdb/remotedb: fix flawed check in Has/HasAncient
Browse files Browse the repository at this point in the history
  • Loading branch information
holiman authored and cp-wjhan committed Dec 2, 2022
1 parent 3908c73 commit 2f0e482
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ethdb/remotedb/remotedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit 2f0e482

Please sign in to comment.