Skip to content

Commit

Permalink
added last comment + redundant evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
fedejinich committed Nov 23, 2021
1 parent a077370 commit 796fd04
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions rskj-core/src/main/java/org/ethereum/vm/VM.java
Original file line number Diff line number Diff line change
Expand Up @@ -1536,12 +1536,9 @@ private MessageCall getMessageCall(DataWord gas, DataWord codeAddress, Activatio
gasCost = GasCost.add(gasCost, calleeGas);
spendOpCodeGas();

// the gas needed for the estimateGas will be given by gasUsed instead of maxGasUsed
// this is because the remaining gas it's spent and passed to the child, when it's actually not being spend
boolean passedRemainingGasToChild = calleeGas == remainingGas;
if(passedRemainingGasToChild) {
program.getResult().movedRemainingGasToChild(true);
}
// when there's less gas than expected from the child call,
// the estimateGas will be given by gasUsed + deductedRefunds instead of maxGasUsed
program.getResult().movedRemainingGasToChild(calleeGas == remainingGas);
}

if (isLogEnabled) {
Expand Down

0 comments on commit 796fd04

Please sign in to comment.