Skip to content

Commit

Permalink
modify getCallEnergy
Browse files Browse the repository at this point in the history
  • Loading branch information
neo hong committed Aug 27, 2021
1 parent 1646399 commit 0a234bc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions actuator/src/main/java/org/tron/core/actuator/VMActuator.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@ public void execute(Object object) throws ContractExeException {
byte[] code = program.getResult().getHReturn();
if (vmConfig.allowTvmLondon() && code[0] == (byte) 0xEF) {
// todo deal with exception
// throw new Program.BytecodeExecutionException("Contract creation error: code cannot "
// + "start with {}", "0xEF");
if (null == result.getException()) {
result.setException(Program.Exception
.invalidOpCode((byte) 0xEF));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ public void checkTokenIdInTokenBalance(DataWord tokenIdDataWord) {
public DataWord getCallEnergy(OpCode op, DataWord requestedEnergy, DataWord availableEnergy) {
if (getContractVersion() == 1) {
DataWord availableEnergyReduce = availableEnergy.clone();
availableEnergyReduce.div(new DataWord(intToBytes(64)));
availableEnergyReduce.div(new DataWord(64));
availableEnergy.sub(availableEnergyReduce);
}
return requestedEnergy.compareTo(availableEnergy) > 0 ? availableEnergy : requestedEnergy;
Expand Down

0 comments on commit 0a234bc

Please sign in to comment.