We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 824c53e + 6473259 commit dd1dff6Copy full SHA for dd1dff6
1 file changed
ctxcdb/remotedb/remotedb.go
@@ -34,7 +34,7 @@ type Database struct {
34
35
func (db *Database) Has(key []byte) (bool, error) {
36
if _, err := db.Get(key); err != nil {
37
- return false, nil
+ return false, err
38
}
39
return true, nil
40
@@ -50,7 +50,7 @@ func (db *Database) Get(key []byte) ([]byte, error) {
50
51
func (db *Database) HasAncient(kind string, number uint64) (bool, error) {
52
if _, err := db.Ancient(kind, number); err != nil {
53
54
55
56
@@ -152,7 +152,8 @@ func (db *Database) Close() error {
152
153
154
func New(client *rpc.Client) ctxcdb.Database {
155
- return &Database{
156
- remote: client,
+ if client == nil {
+ return nil
157
158
+ return &Database{remote: client}
159
0 commit comments