diff options
author | Felix Lange <fjl@twurst.com> | 2017-04-18 19:25:07 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2017-04-25 08:14:31 +0800 |
commit | f958d7d4822d257598ae36fc3b381040faa5bb30 (patch) | |
tree | 332291db0e8e1e7a41699aad291e5f13f35e6385 /trie/node.go | |
parent | a31d268b76ff13df8e7d060163a842b8ed569793 (diff) | |
download | go-tangerine-f958d7d4822d257598ae36fc3b381040faa5bb30.tar go-tangerine-f958d7d4822d257598ae36fc3b381040faa5bb30.tar.gz go-tangerine-f958d7d4822d257598ae36fc3b381040faa5bb30.tar.bz2 go-tangerine-f958d7d4822d257598ae36fc3b381040faa5bb30.tar.lz go-tangerine-f958d7d4822d257598ae36fc3b381040faa5bb30.tar.xz go-tangerine-f958d7d4822d257598ae36fc3b381040faa5bb30.tar.zst go-tangerine-f958d7d4822d257598ae36fc3b381040faa5bb30.zip |
trie: rework and document key encoding
'encode' and 'decode' are meaningless because the code deals with three
encodings. Document the encodings and give a name to each one.
Diffstat (limited to 'trie/node.go')
-rw-r--r-- | trie/node.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/trie/node.go b/trie/node.go index 4aa0cab65..a7697fc0c 100644 --- a/trie/node.go +++ b/trie/node.go @@ -139,8 +139,8 @@ func decodeShort(hash, buf, elems []byte, cachegen uint16) (node, error) { return nil, err } flag := nodeFlag{hash: hash, gen: cachegen} - key := compactDecode(kbuf) - if key[len(key)-1] == 16 { + key := compactToHex(kbuf) + if hasTerm(key) { // value node val, _, err := rlp.SplitString(rest) if err != nil { |