diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000000..e193f88d62 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,22 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch", + "type": "go", + "request": "launch", + "mode": "debug", + "remotePath": "", + "port": 2345, + "host": "127.0.0.1", + "program": "${fileDirname}", + "env": {}, + "args": ["attach","--exec=debug.traceTransaction('0xb44ab4e708611c6cd2125bdedc013e922e876a6e1d45750541f258b14ae57c48')"], + //"args": ["--rinkeby","--datadir=j:\\rinkeby","--verbosity=0","console"], + "showLog": true + } + ] +} \ No newline at end of file diff --git a/cmd/geth/debug b/cmd/geth/debug new file mode 100644 index 0000000000..e90939e2da Binary files /dev/null and b/cmd/geth/debug differ diff --git a/eth/api.go b/eth/api.go index 6804f79a26..130530772b 100644 --- a/eth/api.go +++ b/eth/api.go @@ -452,12 +452,12 @@ func (api *PrivateDebugAPI) traceBlock(block *types.Block, logConfig *vm.LogConf } statedb, err := blockchain.StateAt(blockchain.GetBlock(block.ParentHash(), block.NumberU64()-1).Root()) if err != nil { - switch err.(type) { + switch err.(type) { case *trie.MissingNodeError: return false, structLogger.StructLogs(), fmt.Errorf("required historical state unavailable") default: return false, structLogger.StructLogs(), err - } + } } receipts, _, usedGas, err := processor.Process(block, statedb, config) @@ -503,7 +503,6 @@ func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, txHash common. return nil, err } - // Handle timeouts and RPC cancellations deadlineCtx, cancel := context.WithTimeout(ctx, timeout) go func() { @@ -524,15 +523,14 @@ func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, txHash common. } msg, context, statedb, err := api.computeTxEnv(blockHash, int(txIndex)) if err != nil { - switch err.(type) { + switch err.(type) { case *trie.MissingNodeError: return nil, fmt.Errorf("required historical state unavailable") default: return nil, err - } + } } - // Run the transaction with tracing enabled. vmenv := vm.NewEVM(context, statedb, api.config, vm.Config{Debug: true, Tracer: tracer}) ret, gas, failed, err := core.ApplyMessage(vmenv, msg, new(core.GasPool).AddGas(tx.Gas())) diff --git a/geth.exe b/geth.exe new file mode 100644 index 0000000000..e2c3c55f55 Binary files /dev/null and b/geth.exe differ