aboutsummaryrefslogtreecommitdiffstats
path: root/trie
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-05-24 18:46:45 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-05-24 18:46:45 +0800
commitd31802312a7ae1ed816daf8fe674efd42493adb1 (patch)
tree3288b4fc2abc980f1c59f8250774498148ba07c7 /trie
parentfbf57d53e272c2d79d4d899bb94db824678de2d5 (diff)
downloadgo-tangerine-d31802312a7ae1ed816daf8fe674efd42493adb1.tar
go-tangerine-d31802312a7ae1ed816daf8fe674efd42493adb1.tar.gz
go-tangerine-d31802312a7ae1ed816daf8fe674efd42493adb1.tar.bz2
go-tangerine-d31802312a7ae1ed816daf8fe674efd42493adb1.tar.lz
go-tangerine-d31802312a7ae1ed816daf8fe674efd42493adb1.tar.xz
go-tangerine-d31802312a7ae1ed816daf8fe674efd42493adb1.tar.zst
go-tangerine-d31802312a7ae1ed816daf8fe674efd42493adb1.zip
trie: cleaner logic, one less func call
Diffstat (limited to 'trie')
-rw-r--r--trie/hasher.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/trie/hasher.go b/trie/hasher.go
index 2fc44787a..ff61e7092 100644
--- a/trie/hasher.go
+++ b/trie/hasher.go
@@ -196,12 +196,12 @@ func (h *hasher) store(n node, db *Database, force bool) (node, error) {
if h.onleaf != nil {
switch n := n.(type) {
case *shortNode:
- if child, ok := n.Val.(valueNode); ok {
+ if child, ok := n.Val.(valueNode); ok && child != nil {
h.onleaf(child, hash)
}
case *fullNode:
for i := 0; i < 16; i++ {
- if child, ok := n.Children[i].(valueNode); ok {
+ if child, ok := n.Children[i].(valueNode); ok && child != nil {
h.onleaf(child, hash)
}
}