mirror of https://github.com/poanetwork/quorum.git
fix debug.traceTransaction VM in read-only mode error for public tx (#875)
This commit is contained in:
parent
e1e3e4a781
commit
356cf0da8f
|
@ -633,6 +633,12 @@ func (api *PrivateDebugAPI) traceTx(ctx context.Context, message core.Message, v
|
|||
default:
|
||||
tracer = vm.NewStructLogger(config.LogConfig)
|
||||
}
|
||||
|
||||
// Set the private state to public state if it is not a private message
|
||||
if msg, ok := message.(core.PrivateMessage); !ok || !api.config.IsQuorum || !msg.IsPrivate() {
|
||||
privateStateDb = statedb
|
||||
}
|
||||
|
||||
// Run the transaction with tracing enabled.
|
||||
vmenv := vm.NewEVM(vmctx, statedb, privateStateDb, api.config, vm.Config{Debug: true, Tracer: tracer})
|
||||
|
||||
|
|
Loading…
Reference in New Issue