Skip to content

Commit 496e479

Browse files
UdjinM6claude
authored andcommitted
refactor: drop unused m_quorums_watch member from NetDKG
The NetDKG::m_quorums_watch member was stored by both constructors but never read: the active path forwards quorums_watch into each ActiveDKGSessionHandler (feeding the live QuorumsWatch() accessor), while NetDKG's own copy was dead. Remove the member, drop the now-unused quorums_watch parameter from the observer-mode constructor (and its init.cpp call site), and keep it on the active-mode constructor where it is still forwarded to the handler. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 4d7a2ca commit 496e479

3 files changed

Lines changed: 3 additions & 6 deletions

File tree

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2241,7 +2241,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
22412241
*node.active_ctx->nodeman, *node.connman));
22422242
} else if (node.observer_ctx) {
22432243
node.peerman->AddExtraHandler(std::make_unique<llmq::NetDKG>(
2244-
node.peerman.get(), *node.sporkman, *node.observer_ctx->qdkgsman, chainman, /*quorums_watch=*/true,
2244+
node.peerman.get(), *node.sporkman, *node.observer_ctx->qdkgsman, chainman,
22452245
*node.llmq_ctx->qman, *node.observer_ctx));
22462246
} else {
22472247
node.peerman->AddExtraHandler(std::make_unique<llmq::NetDKGStub>(node.peerman.get()));

src/llmq/net_dkg.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,12 @@ bool ProcessPendingMessageBatch(const CConnman& connman, CDKGSession& session, C
216216

217217

218218
NetDKG::NetDKG(PeerManagerInternal* peer_manager, const CSporkManager& sporkman, CDKGSessionManager& qdkgsman,
219-
const ChainstateManager& chainman, bool quorums_watch, CQuorumManager& qman, QuorumRole& role) :
219+
const ChainstateManager& chainman, CQuorumManager& qman, QuorumRole& role) :
220220
NetHandler(peer_manager),
221221
m_qdkgsman{qdkgsman},
222222
m_qman{qman},
223223
m_sporkman{sporkman},
224224
m_chainman{chainman},
225-
m_quorums_watch{quorums_watch},
226225
m_active{nullptr}
227226
{
228227
m_qdkgsman.InitializeHandlers([](const Consensus::LLMQParams& llmq_params,
@@ -242,7 +241,6 @@ NetDKG::NetDKG(PeerManagerInternal* peer_manager, const CSporkManager& sporkman,
242241
m_qman{qman},
243242
m_sporkman{sporkman},
244243
m_chainman{chainman},
245-
m_quorums_watch{quorums_watch},
246244
m_active{std::make_unique<ActiveDKG>(ActiveDKG{dmnman, mn_metaman, dkgdbgman, qblockman, qsnapman, connman})}
247245
{
248246
m_qdkgsman.InitializeHandlers(

src/llmq/net_dkg.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class NetDKG final : public NetHandler
5454
public:
5555
//! Observer-mode constructor.
5656
NetDKG(PeerManagerInternal* peer_manager, const CSporkManager& sporkman, CDKGSessionManager& qdkgsman,
57-
const ChainstateManager& chainman, bool quorums_watch, CQuorumManager& qman, QuorumRole& role);
57+
const ChainstateManager& chainman, CQuorumManager& qman, QuorumRole& role);
5858

5959
//! Active-mode constructor: takes the masternode-only dep bundle as required references.
6060
NetDKG(PeerManagerInternal* peer_manager, const CSporkManager& sporkman, CDKGSessionManager& qdkgsman,
@@ -96,7 +96,6 @@ class NetDKG final : public NetHandler
9696
CQuorumManager& m_qman;
9797
const CSporkManager& m_sporkman;
9898
const ChainstateManager& m_chainman;
99-
const bool m_quorums_watch;
10099
const std::unique_ptr<ActiveDKG> m_active; //!< null in observer mode, non-null in active mode
101100

102101
/** Cache: quorum hash → quorum index, populated lazily by ProcessMessage. */

0 commit comments

Comments
 (0)