diff --git a/core/state/access_witness.go b/core/state/access_witness.go index 152c47cf3df0..2c05a3f76a78 100644 --- a/core/state/access_witness.go +++ b/core/state/access_witness.go @@ -106,12 +106,12 @@ func (aw *AccessWitness) TouchAndChargeMessageCall(addr []byte, useGasFn UseGasF } func (aw *AccessWitness) TouchAndChargeValueTransfer(callerAddr, targetAddr []byte, useGasFn UseGasFn) bool { - _, ok := aw.touchAddressAndChargeGas(callerAddr, zeroTreeIndex, utils.BasicDataLeafKey, true, useGasFn) + chargedGas1, ok := aw.touchAddressAndChargeGas(callerAddr, zeroTreeIndex, utils.BasicDataLeafKey, true, useGasFn) if !ok { return false } - chargedGas, ok := aw.touchAddressAndChargeGas(targetAddr, zeroTreeIndex, utils.BasicDataLeafKey, true, useGasFn) - return ok && (chargedGas > 0 || useGasFn(params.WarmStorageReadCostEIP2929)) + chargedGas2, ok := aw.touchAddressAndChargeGas(targetAddr, zeroTreeIndex, utils.BasicDataLeafKey, true, useGasFn) + return ok && (chargedGas1+chargedGas2 > 0 || useGasFn(params.WarmStorageReadCostEIP2929)) } // TouchAndChargeContractCreateCheck charges access costs before