trie: make must-parse panics a bit more informative

This commit is contained in:
Péter Szilágyi 2019-02-11 13:17:03 +02:00
parent 672d3afd2b
commit a0a2ed1c09
No known key found for this signature in database
GPG key ID: E9AE538CEDF8293D

View file

@ -120,7 +120,7 @@ func (n valueNode) fstring(ind string) string {
func mustDecodeNode(hash, buf []byte, cachegen uint16) node { func mustDecodeNode(hash, buf []byte, cachegen uint16) node {
n, err := decodeNode(hash, buf, cachegen) n, err := decodeNode(hash, buf, cachegen)
if err != nil { if err != nil {
panic(fmt.Sprintf("node %x: %v", hash, err)) panic(fmt.Sprintf("node %x (%x): %v", hash, buf, err))
} }
return n return n
} }