Skip to content

Commit

Permalink
Merge pull request ethereum#24905 from holiman/fix_has
Browse files Browse the repository at this point in the history
ethdb/remotedb: fix flawed check in Has/HasAncient
  • Loading branch information
karalabe authored and jagdeep sidhu committed May 31, 2022
1 parent 740f413 commit 0293fdd
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 0293fdd

Please sign in to comment.