From f2730d3781030f26c9d3e0a82821e86d356ea508 Mon Sep 17 00:00:00 2001 From: cocoyeal Date: Mon, 20 May 2024 17:36:22 +0800 Subject: [PATCH 1/2] update the `valid` function comments. --- trie/sync.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/trie/sync.go b/trie/sync.go index e609f69e2bb6..711c732cd1f2 100644 --- a/trie/sync.go +++ b/trie/sync.go @@ -157,7 +157,10 @@ type nodeOp struct { hash common.Hash // hash of the node content (empty for node deletion) } -// isDelete indicates if the operation is a database deletion. +// valid checks whether the node operation is valid. +// +// for node deletion, the node blob must be zero-length. +// for node update, the node blob must be non-zero-length. func (op *nodeOp) valid() bool { if op.del && len(op.blob) != 0 { return false From 0882b353c2cfd8743d435cfb769686131f7cf668 Mon Sep 17 00:00:00 2001 From: rjl493456442 Date: Tue, 21 May 2024 15:06:30 +0800 Subject: [PATCH 2/2] Update sync.go --- trie/sync.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/trie/sync.go b/trie/sync.go index 711c732cd1f2..3b7caae5b103 100644 --- a/trie/sync.go +++ b/trie/sync.go @@ -158,9 +158,6 @@ type nodeOp struct { } // valid checks whether the node operation is valid. -// -// for node deletion, the node blob must be zero-length. -// for node update, the node blob must be non-zero-length. func (op *nodeOp) valid() bool { if op.del && len(op.blob) != 0 { return false