|
|
|
@ -17,8 +17,6 @@ |
|
|
|
|
package trie |
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
|
"fmt" |
|
|
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/common" |
|
|
|
|
"github.com/ethereum/go-ethereum/core/types" |
|
|
|
|
"github.com/ethereum/go-ethereum/log" |
|
|
|
@ -74,7 +72,7 @@ func NewStateTrie(owner common.Hash, root common.Hash, db *Database) (*StateTrie |
|
|
|
|
func (t *StateTrie) Get(key []byte) []byte { |
|
|
|
|
res, err := t.TryGet(key) |
|
|
|
|
if err != nil { |
|
|
|
|
log.Error(fmt.Sprintf("Unhandled trie error: %v", err)) |
|
|
|
|
log.Error("Unhandled trie error in StateTrie.Get", "err", err) |
|
|
|
|
} |
|
|
|
|
return res |
|
|
|
|
} |
|
|
|
@ -129,7 +127,7 @@ func (t *StateTrie) TryGetNode(path []byte) ([]byte, int, error) { |
|
|
|
|
// stored in the trie.
|
|
|
|
|
func (t *StateTrie) Update(key, value []byte) { |
|
|
|
|
if err := t.TryUpdate(key, value); err != nil { |
|
|
|
|
log.Error(fmt.Sprintf("Unhandled trie error: %v", err)) |
|
|
|
|
log.Error("Unhandled trie error in StateTrie.Update", "err", err) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -169,7 +167,7 @@ func (t *StateTrie) TryUpdateAccount(key []byte, acc *types.StateAccount) error |
|
|
|
|
// Delete removes any existing value for key from the trie.
|
|
|
|
|
func (t *StateTrie) Delete(key []byte) { |
|
|
|
|
if err := t.TryDelete(key); err != nil { |
|
|
|
|
log.Error(fmt.Sprintf("Unhandled trie error: %v", err)) |
|
|
|
|
log.Error("Unhandled trie error in StateTrie.Delete", "err", err) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|