aboutsummaryrefslogtreecommitdiffstats
path: root/trie/errors.go
diff options
context:
space:
mode:
authorzsfelfoldi <zsfelfoldi@gmail.com>2015-11-30 20:34:19 +0800
committerzsfelfoldi <zsfelfoldi@gmail.com>2015-12-17 23:07:54 +0800
commitef422ee1e1eef831c681aaec31ce7da23b12ae6d (patch)
tree771913e23581908925e4f4b547e8a316ae89e46c /trie/errors.go
parente6408617049d10a6366eef33ea9e97b58c7e30f9 (diff)
downloadgo-tangerine-ef422ee1e1eef831c681aaec31ce7da23b12ae6d.tar
go-tangerine-ef422ee1e1eef831c681aaec31ce7da23b12ae6d.tar.gz
go-tangerine-ef422ee1e1eef831c681aaec31ce7da23b12ae6d.tar.bz2
go-tangerine-ef422ee1e1eef831c681aaec31ce7da23b12ae6d.tar.lz
go-tangerine-ef422ee1e1eef831c681aaec31ce7da23b12ae6d.tar.xz
go-tangerine-ef422ee1e1eef831c681aaec31ce7da23b12ae6d.tar.zst
go-tangerine-ef422ee1e1eef831c681aaec31ce7da23b12ae6d.zip
light: implemented odr-capable trie and state structures
Diffstat (limited to 'trie/errors.go')
-rw-r--r--trie/errors.go18
1 files changed, 14 insertions, 4 deletions
diff --git a/trie/errors.go b/trie/errors.go
index a0f58f28f..fd0e6f0a9 100644
--- a/trie/errors.go
+++ b/trie/errors.go
@@ -27,13 +27,23 @@ import (
// information necessary for retrieving the missing node through an ODR service.
//
// NodeHash is the hash of the missing node
+//
// RootHash is the original root of the trie that contains the node
-// KeyPrefix is the prefix that leads from the root to the missing node (hex encoded)
-// KeySuffix (optional) contains the rest of the key we were looking for, gives a
-// hint on which further nodes should also be retrieved (hex encoded)
+//
+// Key is a binary-encoded key that contains the prefix that leads to the first
+// missing node and optionally a suffix that hints on which further nodes should
+// also be retrieved
+//
+// PrefixLen is the nibble length of the key prefix that leads from the root to
+// the missing node
+//
+// SuffixLen is the nibble length of the remaining part of the key that hints on
+// which further nodes should also be retrieved (can be zero when there are no
+// such hints in the error message)
type MissingNodeError struct {
RootHash, NodeHash common.Hash
- KeyPrefix, KeySuffix []byte
+ Key []byte
+ PrefixLen, SuffixLen int
}
func (err *MissingNodeError) Error() string {