Skip to content

Commit 95d53ba

Browse files
committed
Modify the method of getting the address of black hole
1 parent 53ea878 commit 95d53ba

16 files changed

Lines changed: 20 additions & 15 deletions

actuator/src/main/java/org/tron/core/actuator/AccountPermissionUpdateActuator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public boolean execute(Object object) throws ContractExeException {
5353
accountStore.put(ownerAddress, account);
5454

5555
Commons.adjustBalance(accountStore, ownerAddress, -fee);
56-
Commons.adjustBalance(accountStore, accountStore.getBlackhole().createDbKey(), fee);
56+
Commons.adjustBalance(accountStore, accountStore.getBlackhole(), fee);
5757

5858
result.setStatus(fee, code.SUCESS);
5959
} catch (BalanceInsufficientException | InvalidProtocolBufferException e) {

actuator/src/main/java/org/tron/core/actuator/AssetIssueActuator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public boolean execute(Object result) throws ContractExeException {
8585
}
8686

8787
Commons.adjustBalance(accountStore, ownerAddress, -fee);
88-
Commons.adjustBalance(accountStore, accountStore.getBlackhole().getAddress().toByteArray(),
88+
Commons.adjustBalance(accountStore, accountStore.getBlackhole(),
8989
fee);//send to blackhole
9090

9191
AccountCapsule accountCapsule = accountStore.get(ownerAddress);

actuator/src/main/java/org/tron/core/actuator/CreateAccountActuator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public boolean execute(Object result)
4949
Commons
5050
.adjustBalance(accountStore, accountCreateContract.getOwnerAddress().toByteArray(), -fee);
5151
// Add to blackhole address
52-
Commons.adjustBalance(accountStore, accountStore.getBlackhole().createDbKey(), fee);
52+
Commons.adjustBalance(accountStore, accountStore.getBlackhole(), fee);
5353

5454
ret.setStatus(fee, code.SUCESS);
5555
} catch (BalanceInsufficientException | InvalidProtocolBufferException e) {

actuator/src/main/java/org/tron/core/actuator/ExchangeCreateActuator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public boolean execute(Object object) throws ContractExeException {
119119
accountStore.put(accountCapsule.createDbKey(), accountCapsule);
120120
dynamicStore.saveLatestExchangeNum(id);
121121

122-
Commons.adjustBalance(accountStore, accountStore.getBlackhole().createDbKey(), fee);
122+
Commons.adjustBalance(accountStore, accountStore.getBlackhole(), fee);
123123

124124
ret.setExchangeId(id);
125125
ret.setStatus(fee, code.SUCESS);

actuator/src/main/java/org/tron/core/actuator/MarketCancelOrderActuator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public boolean execute(Object object) throws ContractExeException {
9393

9494
// fee
9595
accountCapsule.setBalance(accountCapsule.getBalance() - fee);
96-
Commons.adjustBalance(accountStore, accountStore.getBlackhole().createDbKey(), fee);
96+
Commons.adjustBalance(accountStore, accountStore.getBlackhole(), fee);
9797

9898
// 1. return balance and token
9999
MarketUtils.returnSellTokenRemain(orderCapsule, accountCapsule, dynamicStore, assetIssueStore);

actuator/src/main/java/org/tron/core/actuator/MarketSellAssetActuator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public boolean execute(Object object) throws ContractExeException {
124124
// fee
125125
accountCapsule.setBalance(accountCapsule.getBalance() - fee);
126126
// add to blackhole address
127-
Commons.adjustBalance(accountStore, accountStore.getBlackhole().createDbKey(), fee);
127+
Commons.adjustBalance(accountStore, accountStore.getBlackhole(), fee);
128128

129129
// 1. transfer of balance
130130
transferBalanceOrToken(accountCapsule);

actuator/src/main/java/org/tron/core/actuator/ShieldedTransferActuator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public boolean execute(Object result)
7676
executeTransparentFrom(shieldedTransferContract.getTransparentFromAddress().toByteArray(),
7777
shieldedTransferContract.getFromAmount(), ret, fee);
7878
}
79-
Commons.adjustAssetBalanceV2(accountStore.getBlackhole().createDbKey(),
79+
Commons.adjustAssetBalanceV2(accountStore.getBlackhole(),
8080
CommonParameter.getInstance().getZenTokenId(), fee,
8181
accountStore, assetIssueStore, dynamicStore);
8282
} catch (BalanceInsufficientException e) {

actuator/src/main/java/org/tron/core/actuator/TransferActuator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public boolean execute(Object object) throws ContractExeException {
5656
fee = fee + dynamicStore.getCreateNewAccountFeeInSystemContract();
5757
}
5858
Commons.adjustBalance(accountStore, ownerAddress, -fee);
59-
Commons.adjustBalance(accountStore, accountStore.getBlackhole().createDbKey(), fee);
59+
Commons.adjustBalance(accountStore, accountStore.getBlackhole(), fee);
6060
ret.setStatus(fee, code.SUCESS);
6161
Commons.adjustBalance(accountStore, ownerAddress, -amount);
6262
Commons.adjustBalance(accountStore, toAddress, amount);

actuator/src/main/java/org/tron/core/actuator/TransferAssetActuator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public boolean execute(Object result) throws ContractExeException {
7474
long amount = transferAssetContract.getAmount();
7575

7676
Commons.adjustBalance(accountStore, ownerAddress, -fee);
77-
Commons.adjustBalance(accountStore, accountStore.getBlackhole().createDbKey(), fee);
77+
Commons.adjustBalance(accountStore, accountStore.getBlackhole(), fee);
7878

7979
AccountCapsule ownerAccountCapsule = accountStore.get(ownerAddress);
8080
if (!ownerAccountCapsule

actuator/src/main/java/org/tron/core/actuator/WitnessCreateActuator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ private void createWitness(final WitnessCreateContract witnessCreateContract)
140140
Commons
141141
.adjustBalance(accountStore, witnessCreateContract.getOwnerAddress().toByteArray(), -cost);
142142

143-
Commons.adjustBalance(accountStore, accountStore.getBlackhole().createDbKey(), +cost);
143+
Commons.adjustBalance(accountStore, accountStore.getBlackhole(), +cost);
144144

145145
dynamicStore.addTotalCreateWitnessCost(cost);
146146
}

0 commit comments

Comments
 (0)