Skip to content

Commit 2d4a7f9

Browse files
authored
Merge pull request #3613 from tronprotocol/remove-blackhole-account
add packing fee
2 parents d587779 + 3282df0 commit 2d4a7f9

File tree

20 files changed

+257
-70
lines changed

20 files changed

+257
-70
lines changed

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

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

5555
Commons.adjustBalance(accountStore, ownerAddress, -fee);
56-
if (chainBaseManager.getDynamicPropertiesStore().supportTransactionFeePool()) {
57-
chainBaseManager.getDynamicPropertiesStore().addTransactionFeePool(fee);
58-
} else if (chainBaseManager.getDynamicPropertiesStore().supportOptimizeBlackHole()) {
56+
if (chainBaseManager.getDynamicPropertiesStore().supportOptimizeBlackHole()) {
5957
chainBaseManager.getDynamicPropertiesStore().burnTrx(fee);
6058
} else {
6159
Commons.adjustBalance(accountStore, accountStore.getBlackhole(), fee);

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

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

8787
Commons.adjustBalance(accountStore, ownerAddress, -fee);
88-
if (dynamicStore.supportTransactionFeePool()) {
89-
dynamicStore.addTransactionFeePool(fee);
90-
} else if (dynamicStore.supportOptimizeBlackHole()) {
88+
if (dynamicStore.supportOptimizeBlackHole()) {
9189
dynamicStore.burnTrx(fee);
9290
} else {
9391
Commons.adjustBalance(accountStore, accountStore.getBlackhole(), fee);//send to blackhole

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ public boolean execute(Object result)
5151
Commons
5252
.adjustBalance(accountStore, accountCreateContract.getOwnerAddress().toByteArray(), -fee);
5353
// Add to blackhole address
54-
if (dynamicStore.supportTransactionFeePool()) {
55-
dynamicStore.addTransactionFeePool(fee);
56-
} else if (dynamicStore.supportOptimizeBlackHole()) {
54+
if (dynamicStore.supportOptimizeBlackHole()) {
5755
dynamicStore.burnTrx(fee);
5856
} else {
5957
Commons.adjustBalance(accountStore, accountStore.getBlackhole(), fee);

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,7 @@ public boolean execute(Object object) throws ContractExeException {
118118

119119
accountStore.put(accountCapsule.createDbKey(), accountCapsule);
120120
dynamicStore.saveLatestExchangeNum(id);
121-
if (dynamicStore.supportTransactionFeePool()) {
122-
dynamicStore.addTransactionFeePool(fee);
123-
} else if (dynamicStore.supportOptimizeBlackHole()) {
121+
if (dynamicStore.supportOptimizeBlackHole()) {
124122
dynamicStore.burnTrx(fee);
125123
} else {
126124
Commons.adjustBalance(accountStore, accountStore.getBlackhole(), fee);

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@ public boolean execute(Object object) throws ContractExeException {
9797

9898
// fee
9999
accountCapsule.setBalance(accountCapsule.getBalance() - fee);
100-
if (dynamicStore.supportTransactionFeePool()) {
101-
dynamicStore.addTransactionFeePool(fee);
102-
} else if (dynamicStore.supportOptimizeBlackHole()) {
100+
if (dynamicStore.supportOptimizeBlackHole()) {
103101
dynamicStore.burnTrx(fee);
104102
} else {
105103
Commons.adjustBalance(accountStore, accountStore.getBlackhole(), fee);

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,7 @@ public boolean execute(Object object) throws ContractExeException {
126126
// fee
127127
accountCapsule.setBalance(accountCapsule.getBalance() - fee);
128128
// add to blackhole address
129-
if (dynamicStore.supportTransactionFeePool()) {
130-
dynamicStore.addTransactionFeePool(fee);
131-
} else if (dynamicStore.supportOptimizeBlackHole()) {
129+
if (dynamicStore.supportOptimizeBlackHole()) {
132130
dynamicStore.burnTrx(fee);
133131
} else {
134132
Commons.adjustBalance(accountStore, accountStore.getBlackhole(), fee);

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ public boolean execute(Object object) throws ContractExeException {
5757
}
5858

5959
Commons.adjustBalance(accountStore, ownerAddress, -(Math.addExact(fee, amount)));
60-
if (dynamicStore.supportTransactionFeePool()) {
61-
dynamicStore.addTransactionFeePool(fee);
62-
} else if (dynamicStore.supportOptimizeBlackHole()) {
60+
if (dynamicStore.supportOptimizeBlackHole()) {
6361
dynamicStore.burnTrx(fee);
6462
} else {
6563
Commons.adjustBalance(accountStore, accountStore.getBlackhole(), fee);

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ public boolean execute(Object result) throws ContractExeException {
8585
accountStore.put(toAddress, toAccountCapsule);
8686

8787
Commons.adjustBalance(accountStore, ownerAccountCapsule, -fee);
88-
if (dynamicStore.supportTransactionFeePool()) {
89-
dynamicStore.addTransactionFeePool(fee);
90-
} else if (dynamicStore.supportOptimizeBlackHole()) {
88+
if (dynamicStore.supportOptimizeBlackHole()) {
9189
dynamicStore.burnTrx(fee);
9290
} else {
9391
Commons.adjustBalance(accountStore, accountStore.getBlackhole(), fee);

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,7 @@ private void createWitness(final WitnessCreateContract witnessCreateContract)
142142
long cost = dynamicStore.getAccountUpgradeCost();
143143
Commons
144144
.adjustBalance(accountStore, witnessCreateContract.getOwnerAddress().toByteArray(), -cost);
145-
if (dynamicStore.supportTransactionFeePool()) {
146-
dynamicStore.addTransactionFeePool(cost);
147-
} else if (dynamicStore.supportOptimizeBlackHole()) {
145+
if (dynamicStore.supportOptimizeBlackHole()) {
148146
dynamicStore.burnTrx(cost);
149147
} else {
150148
Commons.adjustBalance(accountStore, accountStore.getBlackhole(), +cost);

chainbase/src/main/java/org/tron/core/capsule/TransactionInfoCapsule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public TransactionInfoCapsule() {
3434
}
3535

3636

37-
public long getPunishment() {
38-
return transactionInfo.getPunishment();
37+
public long getPackingFee() {
38+
return transactionInfo.getPackingFee();
3939
}
4040

4141
public long getFee() {

0 commit comments

Comments
 (0)