Skip to content

Commit ca22856

Browse files
Sheldonfjl
authored andcommitted
light: odrTrie tryUpdate should use update (#18107)
TryUpdate does not call t.trie.TryUpdate(key, value) and calls t.trie.TryDelete instead. The update operation simply deletes the corresponding entry, though it could retrieve later by odr. However, it adds further network overhead.
1 parent f5e6634 commit ca22856

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

light/trie.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func (t *odrTrie) TryGet(key []byte) ([]byte, error) {
108108
func (t *odrTrie) TryUpdate(key, value []byte) error {
109109
key = crypto.Keccak256(key)
110110
return t.do(key, func() error {
111-
return t.trie.TryDelete(key)
111+
return t.trie.TryUpdate(key, value)
112112
})
113113
}
114114

0 commit comments

Comments
 (0)