mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
Revisit the solution from PR-260, try keep the API consistent by not incrementing the nonce for trading&lending tx (#371)
This commit is contained in:
parent
ac404683b3
commit
92689943a0
1 changed files with 4 additions and 2 deletions
|
|
@ -468,14 +468,16 @@ func (api *PrivateDebugAPI) traceBlock(ctx context.Context, block *types.Block,
|
|||
jobs <- &txTraceTask{statedb: statedb.Copy(), index: i}
|
||||
var balacne *big.Int
|
||||
if tx.To() != nil {
|
||||
// Bypass the validation for trading and lending transactions as their nonce are not incremented
|
||||
if tx.IsSkipNonceTransaction() {
|
||||
continue
|
||||
}
|
||||
if value, ok := feeCapacity[*tx.To()]; ok {
|
||||
balacne = value
|
||||
}
|
||||
}
|
||||
// Generate the next state snapshot fast without tracing
|
||||
msg, _ := tx.AsMessage(signer, balacne, block.Number())
|
||||
// Set nonce to fix issue #256
|
||||
msg.SetNonce(statedb.GetNonce(*tx.From()))
|
||||
vmctx := core.NewEVMContext(msg, block.Header(), api.eth.blockchain, nil)
|
||||
|
||||
vmenv := vm.NewEVM(vmctx, statedb, XDCxState, api.config, vm.Config{})
|
||||
|
|
|
|||
Loading…
Reference in a new issue