Skip to content

Commit

Permalink
fix missing gas sum
Browse files Browse the repository at this point in the history
Signed-off-by: Ignacio Hagopian <[email protected]>
  • Loading branch information
jsign committed Sep 25, 2024
1 parent f7db43f commit 2ef884e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/state/access_witness.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ func (aw *AccessWitness) TouchAndChargeMessageCall(addr []byte, availableGas uin
}

func (aw *AccessWitness) TouchAndChargeValueTransfer(callerAddr, targetAddr []byte, availableGas uint64) uint64 {
chargedGas, _ := aw.touchAddressAndChargeGas(callerAddr, zeroTreeIndex, utils.BasicDataLeafKey, true, availableGas)
chargedGas, _ = aw.touchAddressAndChargeGas(targetAddr, zeroTreeIndex, utils.BasicDataLeafKey, true, availableGas-chargedGas)
return chargedGas
chargedGas1, _ := aw.touchAddressAndChargeGas(callerAddr, zeroTreeIndex, utils.BasicDataLeafKey, true, availableGas)
chargedGas2, _ := aw.touchAddressAndChargeGas(targetAddr, zeroTreeIndex, utils.BasicDataLeafKey, true, availableGas-chargedGas1)
return chargedGas1 + chargedGas2
}

// TouchAndChargeContractCreateCheck charges access costs before
Expand Down

0 comments on commit 2ef884e

Please sign in to comment.