Skip to content

Commit

Permalink
fix: getListAtChainTip will return the most recent list, rather than …
Browse files Browse the repository at this point in the history
…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 <[email protected]>
  • Loading branch information
HashEngineering committed Dec 18, 2023
1 parent 80b41ce commit 861383a
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Check warning on line 455 in core/src/main/java/org/bitcoinj/evolution/SimplifiedMasternodeListManager.java

View check run for this annotation

Codecov / codecov/patch

core/src/main/java/org/bitcoinj/evolution/SimplifiedMasternodeListManager.java#L455

Added line #L455 was not covered by tests
} else {
return quorumRotationState.getMnListAtH();

Check warning on line 457 in core/src/main/java/org/bitcoinj/evolution/SimplifiedMasternodeListManager.java

View check run for this annotation

Codecov / codecov/patch

core/src/main/java/org/bitcoinj/evolution/SimplifiedMasternodeListManager.java#L457

Added line #L457 was not covered by tests
}
}

// TODO: this needs an argument for LLMQType
public SimplifiedQuorumList getQuorumListAtTip(LLMQParameters.LLMQType llmqType) {
if (!isQuorumRotationEnabled(llmqType)) {
return quorumState.quorumList;
Expand Down

0 comments on commit 861383a

Please sign in to comment.