diff --git a/doc/release-notes-5158.md b/doc/release-notes-5158.md new file mode 100644 index 0000000000..22367d93ce --- /dev/null +++ b/doc/release-notes-5158.md @@ -0,0 +1,4 @@ +Updated RPCs +-------- + +- `quorum info`: The new `previousConsecutiveDKGFailures` field will be returned for rotated LLMQs. This field will hold the number of previous consecutive DKG failures for the corresponding quorumIndex before the currently active one. Note: If no previous commitments were found then 0 will be returned for `previousConsecutiveDKGFailures`. diff --git a/src/rpc/quorums.cpp b/src/rpc/quorums.cpp index 58fa0817d2..2d60e30b33 100644 --- a/src/rpc/quorums.cpp +++ b/src/rpc/quorums.cpp @@ -189,6 +189,17 @@ static UniValue BuildQuorumInfo(const llmq::CQuorumCPtr& quorum, bool includeMem ret.pushKV("quorumIndex", quorum->qc->quorumIndex); ret.pushKV("minedBlock", quorum->minedBlockHash.ToString()); + if (quorum->params.useRotation) { + auto previousActiveCommitment = llmq::quorumBlockProcessor->GetLastMinedCommitmentsByQuorumIndexUntilBlock(quorum->params.type, quorum->m_quorum_base_block_index, quorum->qc->quorumIndex, 0); + if (previousActiveCommitment.has_value()) { + int previousConsecutiveDKGFailures = (quorum->m_quorum_base_block_index->nHeight - previousActiveCommitment.value()->nHeight) / quorum->params.dkgInterval - 1; + ret.pushKV("previousConsecutiveDKGFailures", previousConsecutiveDKGFailures); + } + else { + ret.pushKV("previousConsecutiveDKGFailures", 0); + } + } + if (includeMembers) { UniValue membersArr(UniValue::VARR); for (size_t i = 0; i < quorum->members.size(); i++) {