mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-03-02 17:43:48 +00:00
Merge pull request #24905 from holiman/fix_has
ethdb/remotedb: fix flawed check in Has/HasAncient
This commit is contained in:
commit
7bcbbbf836
1 changed files with 4 additions and 4 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue