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:
rjl493456442
2022-05-30 12:37:42 +02:00
committed by GitHub
parent 86af788790
commit a10660b7f8
2 changed files with 24 additions and 6 deletions
+2 -2
View File
@@ -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)