From 85aafcfb2b82f695f6fbae8db966e213df4ce8ae Mon Sep 17 00:00:00 2001 From: Delweng Date: Wed, 28 Sep 2022 23:52:39 +0800 Subject: [PATCH] eth/tracers: fix a bug in prestateTracer (#25884) --- eth/tracers/native/prestate.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/tracers/native/prestate.go b/eth/tracers/native/prestate.go index 918143a33..a40f84952 100644 --- a/eth/tracers/native/prestate.go +++ b/eth/tracers/native/prestate.go @@ -79,7 +79,7 @@ func (t *prestateTracer) CaptureStart(env *vm.EVM, from common.Address, to commo // The sender balance is after reducing: value and gasLimit. // We need to re-add them to get the pre-tx balance. - fromBal := t.prestate[from].Balance + fromBal := new(big.Int).Set(t.prestate[from].Balance) gasPrice := env.TxContext.GasPrice consumedGas := new(big.Int).Mul(gasPrice, new(big.Int).SetUint64(t.gasLimit)) fromBal.Add(fromBal, new(big.Int).Add(value, consumedGas))