3
0
mirror of https://github.com/Qortal/qortal.git synced 2025-02-14 11:15:49 +00:00

Level 0 online account removals moved inside feature trigger, so it is coordinated with the new validation.

This commit is contained in:
CalDescent 2022-12-05 21:34:26 +00:00
parent 51ad0a5b48
commit a69618133e

View File

@ -378,15 +378,17 @@ public class Block {
List<OnlineAccountData> onlineAccounts = OnlineAccountsManager.getInstance().getOnlineAccounts(onlineAccountsTimestamp); List<OnlineAccountData> onlineAccounts = OnlineAccountsManager.getInstance().getOnlineAccounts(onlineAccountsTimestamp);
onlineAccounts.removeIf(a -> a.getNonce() == null || a.getNonce() < 0); onlineAccounts.removeIf(a -> a.getNonce() == null || a.getNonce() < 0);
// Remove any online accounts that are level 0 // After feature trigger, remove any online accounts that are level 0
onlineAccounts.removeIf(a -> { if (height >= BlockChain.getInstance().getOnlineAccountMinterLevelValidationHeight()) {
try { onlineAccounts.removeIf(a -> {
return Account.getRewardShareEffectiveMintingLevel(repository, a.getPublicKey()) == 0; try {
} catch (DataException e) { return Account.getRewardShareEffectiveMintingLevel(repository, a.getPublicKey()) == 0;
// Something went wrong, so remove the account } catch (DataException e) {
return true; // Something went wrong, so remove the account
} return true;
}); }
});
}
if (onlineAccounts.isEmpty()) { if (onlineAccounts.isEmpty()) {
LOGGER.debug("No online accounts - not even our own?"); LOGGER.debug("No online accounts - not even our own?");