forked from cerc-io/plugeth
cmd/geth: extend traverseRawState command (#24954)
This PR adds node verification into traverseRawState command, so corrupted trie nodes can also be detected.
This commit is contained in:
+2
-2
@@ -307,7 +307,7 @@ func checkStateContent(ctx *cli.Context) error {
|
||||
start []byte
|
||||
)
|
||||
if ctx.NArg() > 1 {
|
||||
return fmt.Errorf("Max 1 argument: %v", ctx.Command.ArgsUsage)
|
||||
return fmt.Errorf("max 1 argument: %v", ctx.Command.ArgsUsage)
|
||||
}
|
||||
if ctx.NArg() > 0 {
|
||||
if d, err := hexutil.Decode(ctx.Args().First()); err != nil {
|
||||
@@ -332,8 +332,8 @@ func checkStateContent(ctx *cli.Context) error {
|
||||
)
|
||||
for it.Next() {
|
||||
count++
|
||||
v := it.Value()
|
||||
k := it.Key()
|
||||
v := it.Value()
|
||||
hasher.Reset()
|
||||
hasher.Write(v)
|
||||
hasher.Read(got)
|
||||
|
||||
Reference in New Issue
Block a user