Skip to content

Commit dfff2c7

Browse files
committed
update condition
1 parent b7b31fb commit dfff2c7

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/main/java/org/tron/common/runtime/RuntimeImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ public long getTotalEnergyLimitWithFixRatio(AccountCapsule creator, AccountCapsu
315315
public long getTotalEnergyLimit(AccountCapsule creator, AccountCapsule caller,
316316
TriggerSmartContract contract, long feeLimit, long callValue)
317317
throws ContractValidateException {
318-
if (VMConfig.allowTvmConstantinople() && Objects.isNull(creator)) {
318+
if (Objects.isNull(creator) && VMConfig.allowTvmConstantinople()) {
319319
return getAccountEnergyLimitWithFixRatio(caller, feeLimit, callValue);
320320
}
321321
// according to version

src/main/java/org/tron/common/storage/DepositImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ public synchronized Storage getStorage(byte[] address) {
342342
storage = new Storage(address, dbManager.getStorageRowStore());
343343
}
344344
ContractCapsule contract = getContract(address);
345-
if (contract != null) {
345+
if (contract != null && !ByteUtil.isNullOrZeroArray(contract.getTrxHash())) {
346346
storage.generateAddrHash(contract.getTrxHash());
347347
}
348348
return storage;

src/main/java/org/tron/core/capsule/ReceiptCapsule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public void payEnergyBill(Manager manager, AccountCapsule origin, AccountCapsule
106106
return;
107107
}
108108

109-
if (VMConfig.allowTvmConstantinople() && Objects.isNull(origin)) {
109+
if (Objects.isNull(origin) && VMConfig.allowTvmConstantinople()) {
110110
payEnergyBill(manager, caller, receipt.getEnergyUsageTotal(), energyProcessor, now);
111111
return;
112112
}

0 commit comments

Comments
 (0)