diff --git a/configure.ac b/configure.ac index d3ff134a02..ad96a2d1e1 100644 --- a/configure.ac +++ b/configure.ac @@ -424,6 +424,7 @@ if test "x$enable_werror" = "xyes"; then AC_MSG_ERROR("enable-werror set but -Werror is not usable") fi AX_CHECK_COMPILE_FLAG([-Werror=reorder],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=reorder"],,[[$CXXFLAG_WERROR]]) + AX_CHECK_COMPILE_FLAG([-Werror=gnu],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=gnu"],,[[$CXXFLAG_WERROR]]) AX_CHECK_COMPILE_FLAG([-Werror=vla],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=vla"],,[[$CXXFLAG_WERROR]]) AX_CHECK_COMPILE_FLAG([-Werror=shadow-field],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=shadow-field"],,[[$CXXFLAG_WERROR]]) AX_CHECK_COMPILE_FLAG([-Werror=switch],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=switch"],,[[$CXXFLAG_WERROR]]) diff --git a/src/llmq/debug.cpp b/src/llmq/debug.cpp index 8f02c3d8d8..6e4e5677c2 100644 --- a/src/llmq/debug.cpp +++ b/src/llmq/debug.cpp @@ -36,11 +36,11 @@ UniValue CDKGDebugSessionStatus::ToJson(int quorumIndex, int detailLevel) const ret.pushKV("quorumHeight", (int)quorumHeight); ret.pushKV("phase", ToUnderlying(phase)); - ret.pushKV("sentContributions", sentContributions); - ret.pushKV("sentComplaint", sentComplaint); - ret.pushKV("sentJustification", sentJustification); - ret.pushKV("sentPrematureCommitment", sentPrematureCommitment); - ret.pushKV("aborted", aborted); + ret.pushKV("sentContributions", statusBits.sentContributions); + ret.pushKV("sentComplaint", statusBits.sentComplaint); + ret.pushKV("sentJustification", statusBits.sentJustification); + ret.pushKV("sentPrematureCommitment", statusBits.sentPrematureCommitment); + ret.pushKV("aborted", statusBits.aborted); struct ArrOrCount { int count{0}; @@ -81,12 +81,12 @@ UniValue CDKGDebugSessionStatus::ToJson(int quorumIndex, int detailLevel) const for (const auto i : irange::range(members.size())) { const auto& m = members[i]; - add(badMembers, i, m.bad); - add(weComplain, i, m.weComplain); - add(receivedContributions, i, m.receivedContribution); - add(receivedComplaints, i, m.receivedComplaint); - add(receivedJustifications, i, m.receivedJustification); - add(receivedPrematureCommitments, i, m.receivedPrematureCommitment); + add(badMembers, i, m.statusBits.bad); + add(weComplain, i, m.statusBits.weComplain); + add(receivedContributions, i, m.statusBits.receivedContribution); + add(receivedComplaints, i, m.statusBits.receivedComplaint); + add(receivedJustifications, i, m.statusBits.receivedJustification); + add(receivedPrematureCommitments, i, m.statusBits.receivedPrematureCommitment); } push(badMembers, "badMembers"); push(weComplain, "weComplain"); diff --git a/src/llmq/debug.h b/src/llmq/debug.h index 253faf13ad..6788bc7c60 100644 --- a/src/llmq/debug.h +++ b/src/llmq/debug.h @@ -37,7 +37,7 @@ public: bool receivedComplaint : 1; bool receivedJustification : 1; bool receivedPrematureCommitment : 1; - }; + } statusBits; uint8_t statusBitset; }; @@ -65,7 +65,7 @@ public: bool sentPrematureCommitment : 1; bool aborted : 1; - }; + } statusBits; uint8_t statusBitset; }; diff --git a/src/llmq/dkgsession.cpp b/src/llmq/dkgsession.cpp index 2a0b888f20..943c28c643 100644 --- a/src/llmq/dkgsession.cpp +++ b/src/llmq/dkgsession.cpp @@ -202,7 +202,7 @@ void CDKGSession::SendContributions(CDKGPendingMessages& pendingMessages) logger.Flush(); dkgDebugManager.UpdateLocalSessionStatus(params.type, quorumIndex, [&](CDKGDebugSessionStatus& status) { - status.sentContributions = true; + status.statusBits.sentContributions = true; return true; }); @@ -285,7 +285,7 @@ void CDKGSession::ReceiveMessage(const CDKGContribution& qc, bool& retBan) RelayInvToParticipants(inv); dkgDebugManager.UpdateLocalMemberStatus(params.type, quorumIndex, member->idx, [&](CDKGDebugMemberStatus& status) { - status.receivedContribution = true; + status.statusBits.receivedContribution = true; return true; }); @@ -325,7 +325,7 @@ void CDKGSession::ReceiveMessage(const CDKGContribution& qc, bool& retBan) if (complain) { member->weComplain = true; dkgDebugManager.UpdateLocalMemberStatus(params.type, quorumIndex, member->idx, [&](CDKGDebugMemberStatus& status) { - status.weComplain = true; + status.statusBits.weComplain = true; return true; }); return; @@ -393,7 +393,7 @@ void CDKGSession::VerifyPendingContributions() logger.Batch("invalid contribution from %s. will complain later", m->dmn->proTxHash.ToString()); m->weComplain = true; dkgDebugManager.UpdateLocalMemberStatus(params.type, quorumIndex, m->idx, [&](CDKGDebugMemberStatus& status) { - status.weComplain = true; + status.statusBits.weComplain = true; return true; }); } else { @@ -520,7 +520,7 @@ void CDKGSession::SendComplaint(CDKGPendingMessages& pendingMessages) logger.Flush(); dkgDebugManager.UpdateLocalSessionStatus(params.type, quorumIndex, [&](CDKGDebugSessionStatus& status) { - status.sentComplaint = true; + status.statusBits.sentComplaint = true; return true; }); @@ -593,7 +593,7 @@ void CDKGSession::ReceiveMessage(const CDKGComplaint& qc, bool& retBan) RelayInvToParticipants(inv); dkgDebugManager.UpdateLocalMemberStatus(params.type, quorumIndex, member->idx, [&](CDKGDebugMemberStatus& status) { - status.receivedComplaint = true; + status.statusBits.receivedComplaint = true; return true; }); @@ -714,7 +714,7 @@ void CDKGSession::SendJustification(CDKGPendingMessages& pendingMessages, const logger.Flush(); dkgDebugManager.UpdateLocalSessionStatus(params.type, quorumIndex, [&](CDKGDebugSessionStatus& status) { - status.sentJustification = true; + status.statusBits.sentJustification = true; return true; }); @@ -804,7 +804,7 @@ void CDKGSession::ReceiveMessage(const CDKGJustification& qj, bool& retBan) RelayInvToParticipants(inv); dkgDebugManager.UpdateLocalMemberStatus(params.type, quorumIndex, member->idx, [&](CDKGDebugMemberStatus& status) { - status.receivedJustification = true; + status.statusBits.receivedJustification = true; return true; }); @@ -1026,7 +1026,7 @@ void CDKGSession::SendCommitment(CDKGPendingMessages& pendingMessages) logger.Flush(); dkgDebugManager.UpdateLocalSessionStatus(params.type, quorumIndex, [&](CDKGDebugSessionStatus& status) { - status.sentPrematureCommitment = true; + status.statusBits.sentPrematureCommitment = true; return true; }); @@ -1163,7 +1163,7 @@ void CDKGSession::ReceiveMessage(const CDKGPrematureCommitment& qc, bool& retBan RelayInvToParticipants(inv); dkgDebugManager.UpdateLocalMemberStatus(params.type, quorumIndex, member->idx, [&](CDKGDebugMemberStatus& status) { - status.receivedPrematureCommitment = true; + status.statusBits.receivedPrematureCommitment = true; return true; }); @@ -1298,7 +1298,7 @@ void CDKGSession::MarkBadMember(size_t idx) return; } dkgDebugManager.UpdateLocalMemberStatus(params.type, quorumIndex, idx, [&](CDKGDebugMemberStatus& status) { - status.bad = true; + status.statusBits.bad = true; return true; }); member->bad = true; diff --git a/src/llmq/dkgsessionhandler.cpp b/src/llmq/dkgsessionhandler.cpp index 3acc3539e1..4cbe4532b5 100644 --- a/src/llmq/dkgsessionhandler.cpp +++ b/src/llmq/dkgsessionhandler.cpp @@ -567,7 +567,7 @@ void CDKGSessionHandler::PhaseHandlerThread() HandleDKGRound(); } catch (AbortPhaseException& e) { dkgDebugManager.UpdateLocalSessionStatus(params.type, quorumIndex, [&](CDKGDebugSessionStatus& status) { - status.aborted = true; + status.statusBits.aborted = true; return true; }); LogPrint(BCLog::LLMQ_DKG, "CDKGSessionHandler::%s -- %s qi[%d] - aborted current DKG session\n", __func__, params.name, quorumIndex);