Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Holst Swende <martin@swende.se>
  • Loading branch information
gballet and holiman committed Sep 17, 2021
1 parent 1e142f9 commit 14ad53a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion light/trie.go
Expand Up @@ -117,7 +117,7 @@ func (t *odrTrie) TryUpdateAccount(key []byte, acc account.Account) error {
key = crypto.Keccak256(key)
value, err := rlp.EncodeToBytes(acc)
if err != nil {
return fmt.Errorf("Decoding error in account update: %w", err)
return fmt.Errorf("decoding error in account update: %w", err)
}
return t.do(key, func() error {
return t.trie.TryUpdate(key, value)
Expand Down
3 changes: 1 addition & 2 deletions trie/secure_trie.go
Expand Up @@ -95,8 +95,7 @@ func (t *SecureTrie) TryUpdateAccount(key []byte, acc account.Account) error {
if err != nil {
return err
}
err = t.trie.TryUpdate(hk, data)
if err != nil {
if err := t.trie.TryUpdate(hk, data); err != nil {
return err
}
t.getSecKeyCache()[string(hk)] = common.CopyBytes(key)
Expand Down

0 comments on commit 14ad53a

Please sign in to comment.