Skip to content

Commit

Permalink
rm useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-liu55 committed Nov 11, 2020
1 parent af76742 commit 4fe888b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ public void withdrawReward(byte[] address) {

public void payTransactionFeeReward(byte[] witnessAddress, long value) {
logger.debug("pay {} transaction fee reward {}", Hex.toHexString(witnessAddress), value);
long cycle = dynamicPropertiesStore.getCurrentCycleNumber();
delegationStore.addTransactionFeeReward(cycle, witnessAddress, value);
payReward(witnessAddress, value);
}

Expand Down
22 changes: 0 additions & 22 deletions chainbase/src/main/java/org/tron/core/store/DelegationStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,28 +71,6 @@ public long getVoteReward(long cycle, byte[] address) {
}
}


public void addTransactionFeeReward(long cycle, byte[] address, long value) {
byte[] key = buildRewardBlockKey(cycle, address);
BytesCapsule bytesCapsule = get(key);

if (bytesCapsule == null) {
put(key, new BytesCapsule(ByteArray.fromLong(value)));
} else {
put(key, new BytesCapsule(ByteArray
.fromLong(ByteArray.toLong(bytesCapsule.getData()) + value)));
}
}

public long getTransactionFeeReward(long cycle, byte[] address) {
BytesCapsule bytesCapsule = get(buildRewardBlockKey(cycle, address));
if (bytesCapsule == null) {
return 0L;
} else {
return ByteArray.toLong(bytesCapsule.getData());
}
}

public void addReward(long cycle, byte[] address, long value) {
byte[] key = buildRewardKey(cycle, address);
BytesCapsule bytesCapsule = get(key);
Expand Down
5 changes: 2 additions & 3 deletions framework/src/main/java/org/tron/core/db/Manager.java
Original file line number Diff line number Diff line change
Expand Up @@ -1357,9 +1357,8 @@ private void payReward(BlockCapsule block) {
long transactionFeeReward = Math
.floorDiv(chainBaseManager.getDynamicPropertiesStore().getTransactionFeePool(),
Constant.TRANSACTION_FEE_POOL_PERIOD);

mortgageService.payBlockReward(witnessCapsule.getAddress().toByteArray(),transactionFeeReward);

mortgageService.payTransactionFeeReward(witnessCapsule.getAddress().toByteArray(),
transactionFeeReward);
}
} else {
byte[] witness = block.getWitnessAddress().toByteArray();
Expand Down

0 comments on commit 4fe888b

Please sign in to comment.