From a69618133e9361bf1b44dd0591fe0d1d9f24fb1b Mon Sep 17 00:00:00 2001 From: CalDescent Date: Mon, 5 Dec 2022 21:34:26 +0000 Subject: [PATCH] Level 0 online account removals moved inside feature trigger, so it is coordinated with the new validation. --- src/main/java/org/qortal/block/Block.java | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/qortal/block/Block.java b/src/main/java/org/qortal/block/Block.java index a31c522b..df0ca7cd 100644 --- a/src/main/java/org/qortal/block/Block.java +++ b/src/main/java/org/qortal/block/Block.java @@ -378,15 +378,17 @@ public class Block { List onlineAccounts = OnlineAccountsManager.getInstance().getOnlineAccounts(onlineAccountsTimestamp); onlineAccounts.removeIf(a -> a.getNonce() == null || a.getNonce() < 0); - // Remove any online accounts that are level 0 - onlineAccounts.removeIf(a -> { - try { - return Account.getRewardShareEffectiveMintingLevel(repository, a.getPublicKey()) == 0; - } catch (DataException e) { - // Something went wrong, so remove the account - return true; - } - }); + // After feature trigger, remove any online accounts that are level 0 + if (height >= BlockChain.getInstance().getOnlineAccountMinterLevelValidationHeight()) { + onlineAccounts.removeIf(a -> { + try { + return Account.getRewardShareEffectiveMintingLevel(repository, a.getPublicKey()) == 0; + } catch (DataException e) { + // Something went wrong, so remove the account + return true; + } + }); + } if (onlineAccounts.isEmpty()) { LOGGER.debug("No online accounts - not even our own?");