From f042b5ca5f4c28b858de897be92c7ec1d3d275c5 Mon Sep 17 00:00:00 2001 From: CalDescent Date: Sun, 11 Sep 2022 11:41:11 +0100 Subject: [PATCH] If mempow is active, remove any legacy accounts from a to-be-minted block that are missing a nonce. --- src/main/java/org/qortal/block/Block.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/qortal/block/Block.java b/src/main/java/org/qortal/block/Block.java index 293cb3eb..c21b97d7 100644 --- a/src/main/java/org/qortal/block/Block.java +++ b/src/main/java/org/qortal/block/Block.java @@ -373,6 +373,11 @@ public class Block { return null; } + // If mempow is active, remove any legacy accounts that are missing a nonce + if (timestamp >= BlockChain.getInstance().getOnlineAccountsMemoryPoWTimestamp()) { + onlineAccounts.removeIf(a -> a.getNonce() < 0); + } + // Load sorted list of reward share public keys into memory, so that the indexes can be obtained. // This is up to 100x faster than querying each index separately. For 4150 reward share keys, it // was taking around 5000ms to query individually, vs 50ms using this approach.