From 861383a4ff15a7172f589660c3ee669647a68a73 Mon Sep 17 00:00:00 2001 From: HashEngineering Date: Mon, 18 Dec 2023 11:39:17 -0800 Subject: [PATCH] fix: getListAtChainTip will return the most recent list, rather than the last qrinfo list * The QRInfo list may be up to 12 hours old * this resolves a masternode list sync bug when requesting mnlistdiff Signed-off-by: HashEngineering --- .../evolution/SimplifiedMasternodeListManager.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/bitcoinj/evolution/SimplifiedMasternodeListManager.java b/core/src/main/java/org/bitcoinj/evolution/SimplifiedMasternodeListManager.java index f73954a37..6799b4cbd 100644 --- a/core/src/main/java/org/bitcoinj/evolution/SimplifiedMasternodeListManager.java +++ b/core/src/main/java/org/bitcoinj/evolution/SimplifiedMasternodeListManager.java @@ -450,12 +450,14 @@ public boolean isQuorumRotationEnabled(LLMQParameters.LLMQType type) { return params.getLlmqDIP0024InstantSend() == type && quorumRotationActive; } - // TODO: this needs an argument for LLMQType public SimplifiedMasternodeList getListAtChainTip() { - return getMasternodeList(); + if (quorumState.getMasternodeListAtTip() != null) { + return quorumState.getMasternodeListAtTip(); + } else { + return quorumRotationState.getMnListAtH(); + } } - // TODO: this needs an argument for LLMQType public SimplifiedQuorumList getQuorumListAtTip(LLMQParameters.LLMQType llmqType) { if (!isQuorumRotationEnabled(llmqType)) { return quorumState.quorumList;