mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 05:36:46 +00:00
Remove panic recover
This commit is contained in:
parent
23651e4329
commit
1358a5e60c
1 changed files with 0 additions and 12 deletions
|
|
@ -874,12 +874,6 @@ func containsTx(block *types.Block, hash common.Hash) bool {
|
||||||
// TraceTransaction returns the structured logs created during the execution of EVM
|
// TraceTransaction returns the structured logs created during the execution of EVM
|
||||||
// and returns them as a JSON object.
|
// and returns them as a JSON object.
|
||||||
func (api *API) TraceTransaction(ctx context.Context, hash common.Hash, config *TraceConfig) (value interface{}, returnErr error) {
|
func (api *API) TraceTransaction(ctx context.Context, hash common.Hash, config *TraceConfig) (value interface{}, returnErr error) {
|
||||||
defer func() {
|
|
||||||
if r := recover(); r != nil {
|
|
||||||
value = nil
|
|
||||||
returnErr = fmt.Errorf("panic occurred: %v, could not trace tx: %s", r, hash.Hex())
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
tx, blockHash, blockNumber, index, err := api.backend.GetTransaction(ctx, hash)
|
tx, blockHash, blockNumber, index, err := api.backend.GetTransaction(ctx, hash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
@ -1011,12 +1005,6 @@ func (api *API) traceTx(ctx context.Context, tx *types.Transaction, message *cor
|
||||||
timeout = defaultTraceTimeout
|
timeout = defaultTraceTimeout
|
||||||
usedGas uint64
|
usedGas uint64
|
||||||
)
|
)
|
||||||
defer func() {
|
|
||||||
if r := recover(); r != nil {
|
|
||||||
value = nil
|
|
||||||
returnErr = fmt.Errorf("panic occurred: %v, could not trace tx: %s", r, tx.Hash())
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
if config == nil {
|
if config == nil {
|
||||||
config = &TraceConfig{}
|
config = &TraceConfig{}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue