aboutsummaryrefslogtreecommitdiffstats
path: root/trie
diff options
context:
space:
mode:
Diffstat (limited to 'trie')
-rw-r--r--trie/sync.go5
-rw-r--r--trie/trie.go1
2 files changed, 3 insertions, 3 deletions
diff --git a/trie/sync.go b/trie/sync.go
index 1e4f8d87c..fea10051f 100644
--- a/trie/sync.go
+++ b/trie/sync.go
@@ -138,7 +138,7 @@ func (s *TrieSync) AddRawEntry(hash common.Hash, depth int, parent common.Hash)
if _, ok := s.membatch.batch[hash]; ok {
return
}
- if blob, _ := s.database.Get(hash.Bytes()); blob != nil {
+ if ok, _ := s.database.Has(hash.Bytes()); ok {
return
}
// Assemble the new sub-trie sync request
@@ -296,8 +296,7 @@ func (s *TrieSync) children(req *request, object node) ([]*request, error) {
if _, ok := s.membatch.batch[hash]; ok {
continue
}
- blob, _ := s.database.Get(node)
- if local, err := decodeNode(node[:], blob, 0); local != nil && err == nil {
+ if ok, _ := s.database.Has(node); ok {
continue
}
// Locally unknown node, schedule for retrieval
diff --git a/trie/trie.go b/trie/trie.go
index a3151b1ce..7f69a3d1d 100644
--- a/trie/trie.go
+++ b/trie/trie.go
@@ -66,6 +66,7 @@ type Database interface {
// DatabaseReader wraps the Get method of a backing store for the trie.
type DatabaseReader interface {
Get(key []byte) (value []byte, err error)
+ Has(key []byte) (bool, error)
}
// DatabaseWriter wraps the Put method of a backing store for the trie.