瀏覽代碼

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.
Sheldon 7 年之前
父節點
當前提交
ca228569e4
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      light/trie.go

+ 1 - 1
light/trie.go

@@ -108,7 +108,7 @@ func (t *odrTrie) TryGet(key []byte) ([]byte, error) {
 func (t *odrTrie) TryUpdate(key, value []byte) error {
 	key = crypto.Keccak256(key)
 	return t.do(key, func() error {
-		return t.trie.TryDelete(key)
+		return t.trie.TryUpdate(key, value)
 	})
 }