aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-05-24 20:54:00 +0800
committerGitHub <noreply@github.com>2018-05-24 20:54:00 +0800
commit54294b45b10bbcdfd0cd64292cbd05d66d12ffd5 (patch)
tree6e93018af2ff88336f3be61ff2f8aaddae9cd2e6
parent55b579e02ce6f374bf81061269eabde0d82ae567 (diff)
parentd31802312a7ae1ed816daf8fe674efd42493adb1 (diff)
downloaddexon-54294b45b10bbcdfd0cd64292cbd05d66d12ffd5.tar.gz
dexon-54294b45b10bbcdfd0cd64292cbd05d66d12ffd5.tar.zst
dexon-54294b45b10bbcdfd0cd64292cbd05d66d12ffd5.zip
Merge pull request #16803 from karalabe/trie-avoid-funccall
trie: cleaner logic, one less func call
-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)
}
}