mirror of
https://github.com/Qortal/qortal.git
synced 2025-02-11 09:45:50 +00:00
removed the NULL account from the dev admin reward distribution and added some fail safes in case the admin groups are empty
This commit is contained in:
parent
2805bb8364
commit
a8a8904ebf
@ -26,6 +26,7 @@ import org.qortal.data.block.BlockTransactionData;
|
||||
import org.qortal.data.group.GroupAdminData;
|
||||
import org.qortal.data.network.OnlineAccountData;
|
||||
import org.qortal.data.transaction.TransactionData;
|
||||
import org.qortal.group.Group;
|
||||
import org.qortal.repository.*;
|
||||
import org.qortal.settings.Settings;
|
||||
import org.qortal.transaction.AtTransaction;
|
||||
@ -2497,21 +2498,28 @@ public class Block {
|
||||
.filter(expandedAccount -> minterAdmins.contains(expandedAccount.getMintingAccount().getAddress()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
BlockRewardDistributor minterAdminDistributor
|
||||
= (distributionAmount, balanceChanges)
|
||||
->
|
||||
distributeBlockRewardShare(distributionAmount, onlineMinterAdminAccounts, balanceChanges);
|
||||
long minterAdminShare;
|
||||
|
||||
long adminShare = 1_00000000 - totalShares;
|
||||
LOGGER.info("initial total Shares: {}",totalShares);
|
||||
LOGGER.info("logging adminShare after hardfork, this is the primary reward that will be split {}",adminShare);
|
||||
if( onlineMinterAdminAccounts.isEmpty() ) {
|
||||
minterAdminShare = 0;
|
||||
}
|
||||
else {
|
||||
BlockRewardDistributor minterAdminDistributor
|
||||
= (distributionAmount, balanceChanges)
|
||||
->
|
||||
distributeBlockRewardShare(distributionAmount, onlineMinterAdminAccounts, balanceChanges);
|
||||
|
||||
long minterAdminShare = adminShare / 2;
|
||||
BlockRewardCandidate minterAdminRewardCandidate
|
||||
= new BlockRewardCandidate("Minter Admins", minterAdminShare, minterAdminDistributor);
|
||||
rewardCandidates.add(minterAdminRewardCandidate);
|
||||
long adminShare = 1_00000000 - totalShares;
|
||||
LOGGER.info("initial total Shares: {}", totalShares);
|
||||
LOGGER.info("logging adminShare after hardfork, this is the primary reward that will be split {}", adminShare);
|
||||
|
||||
totalShares += minterAdminShare;
|
||||
minterAdminShare = adminShare / 2;
|
||||
BlockRewardCandidate minterAdminRewardCandidate
|
||||
= new BlockRewardCandidate("Minter Admins", minterAdminShare, minterAdminDistributor);
|
||||
rewardCandidates.add(minterAdminRewardCandidate);
|
||||
|
||||
totalShares += minterAdminShare;
|
||||
}
|
||||
|
||||
LOGGER.info("MINTER ADMIN SHARE: {}",minterAdminShare);
|
||||
|
||||
@ -2521,6 +2529,10 @@ public class Block {
|
||||
.map(GroupAdminData::getAdmin)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
LOGGER.info("Removing NULL Account Address, Dev Admin Count = {}", devAdminAddresses.size());
|
||||
devAdminAddresses.removeIf( address -> Group.NULL_OWNER_ADDRESS.equals(address) );
|
||||
LOGGER.info("Removed NULL Account Address, Dev Admin Count = {}", devAdminAddresses.size());
|
||||
|
||||
BlockRewardDistributor devAdminDistributor
|
||||
= (distributionAmount, balanceChanges) -> distributeToAccounts(distributionAmount, devAdminAddresses, balanceChanges);
|
||||
|
||||
@ -2548,6 +2560,8 @@ public class Block {
|
||||
*/
|
||||
public static long distributeToAccounts(long distributionAmount, List<String> accountAddressess, Map<String, Long> balanceChanges) {
|
||||
|
||||
if( accountAddressess.isEmpty() ) return 0;
|
||||
|
||||
long distibutionShare = distributionAmount / accountAddressess.size();
|
||||
|
||||
for(String accountAddress : accountAddressess ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user