cmd/evm: reopen the statedb for dumping (#29437)
This commit is contained in:
parent
0bd03dbc55
commit
fe0bf325a6
|
@ -272,8 +272,17 @@ func runCmd(ctx *cli.Context) error {
|
||||||
output, leftOverGas, stats, err := timedExec(bench, execFunc)
|
output, leftOverGas, stats, err := timedExec(bench, execFunc)
|
||||||
|
|
||||||
if ctx.Bool(DumpFlag.Name) {
|
if ctx.Bool(DumpFlag.Name) {
|
||||||
statedb.Commit(genesisConfig.Number, true)
|
root, err := statedb.Commit(genesisConfig.Number, true)
|
||||||
fmt.Println(string(statedb.Dump(nil)))
|
if err != nil {
|
||||||
|
fmt.Printf("Failed to commit changes %v\n", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
dumpdb, err := state.New(root, sdb, nil)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("Failed to open statedb %v\n", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
fmt.Println(string(dumpdb.Dump(nil)))
|
||||||
}
|
}
|
||||||
|
|
||||||
if ctx.Bool(DebugFlag.Name) {
|
if ctx.Bool(DebugFlag.Name) {
|
||||||
|
|
Loading…
Reference in New Issue