ethdb/remotedb: fix flawed check in Has/HasAncient
This commit is contained in:
parent
5c5ef6f16e
commit
2f4996a9b2
@ -37,10 +37,10 @@ type Database struct {
|
|||||||
|
|
||||||
func (db *Database) Has(key []byte) (bool, error) {
|
func (db *Database) Has(key []byte) (bool, error) {
|
||||||
if _, err := db.Get(key); err != nil {
|
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) {
|
func (db *Database) Get(key []byte) ([]byte, error) {
|
||||||
var resp hexutil.Bytes
|
var resp hexutil.Bytes
|
||||||
@ -53,10 +53,10 @@ func (db *Database) Get(key []byte) ([]byte, error) {
|
|||||||
|
|
||||||
func (db *Database) HasAncient(kind string, number uint64) (bool, error) {
|
func (db *Database) HasAncient(kind string, number uint64) (bool, error) {
|
||||||
if _, err := db.Ancient(kind, number); err != nil {
|
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) {
|
func (db *Database) Ancient(kind string, number uint64) ([]byte, error) {
|
||||||
var resp hexutil.Bytes
|
var resp hexutil.Bytes
|
||||||
|
Loading…
Reference in New Issue
Block a user