mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 07:06:42 +00:00
fix remotedb.go
This commit is contained in:
parent
d219e9b005
commit
35c06da30b
1 changed files with 6 additions and 4 deletions
|
|
@ -33,8 +33,9 @@ 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 {
|
_, err := db.Get(key)
|
||||||
return false, nil
|
if err != nil {
|
||||||
|
return false, err
|
||||||
}
|
}
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
@ -144,7 +145,8 @@ func (db *Database) Close() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func New(client *rpc.Client) ethdb.Database {
|
func New(client *rpc.Client) ethdb.Database {
|
||||||
return &Database{
|
if client == nil {
|
||||||
remote: client,
|
return nil
|
||||||
}
|
}
|
||||||
|
return &Database{remote: client}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue