-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: correctly detect and skip disconnecting pending quorum masternodes #6984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
✅ No Merge Conflicts DetectedThis PR currently has no conflicts with other open PRs. |
WalkthroughThe Sequence Diagram(s)sequenceDiagram
participant Caller
participant CConnman
participant PNodeList as "pnode (iterable)"
Caller->>CConnman: FindNodeMutable(addr, fExcludeDisconnecting=false)
Note right of CConnman: iterate over connected nodes
CConnman->>PNodeList: for each pnode
alt pnode is masternode connection OR pnode->fDisconnect == true
Note right of PNodeList `#f9f0c1`: SKIP node (new combined guard)
PNodeList-->>CConnman: continue
else match addr
PNodeList-->>CConnman: return pnode
end
CConnman-->>Caller: pnode or nullptr
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/net.cpp(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: UdjinM6
Repo: dashpay/dash PR: 6933
File: src/llmq/utils.cpp:284-298
Timestamp: 2025-11-04T18:24:27.241Z
Learning: In consensus-critical code (such as quorum formation, block validation, or deployment activation logic), do not suggest changes to the logic itself even if the implementation appears theoretically incorrect or off-by-one. Consensus rules, once deployed on the Dash network, must be preserved exactly to avoid network forks. Refactoring PRs should maintain perfect behavioral equivalence. Only suggest logic changes if explicitly accompanied by a DIP (Dash Improvement Proposal) or if the maintainer indicates the consensus rule needs to be changed with appropriate activation logic.
Learnt from: kwvg
Repo: dashpay/dash PR: 6718
File: test/functional/test_framework/test_framework.py:2102-2102
Timestamp: 2025-06-09T16:43:20.996Z
Learning: In the test framework consolidation PR (#6718), user kwvg prefers to limit functional changes to those directly related to MasternodeInfo, avoiding scope creep even for minor improvements like error handling consistency.
Learnt from: kwvg
Repo: dashpay/dash PR: 6761
File: src/chainlock/signing.cpp:247-250
Timestamp: 2025-07-29T14:32:48.369Z
Learning: In PR #6761, kwvg acknowledged a null pointer check issue in ChainLockSigner::Cleanup() method but deferred it to follow-up, consistent with the pattern of avoiding scope creep in refactoring PRs.
Learnt from: kwvg
Repo: dashpay/dash PR: 6543
File: src/wallet/receive.cpp:240-251
Timestamp: 2025-02-06T14:34:30.466Z
Learning: Pull request #6543 is focused on move-only changes and refactoring, specifically backporting from Bitcoin. Behavior changes should be proposed in separate PRs.
🔇 Additional comments (1)
src/net.cpp (1)
3385-3389: LGTM - Correctly detects and skips disconnecting nodes.The fix appropriately addresses the issue from PR #6912 by:
- Calling
FindNodeMutablewithfExcludeDisconnecting=falseto retrieve nodes even if they're disconnecting- Checking both
m_masternode_connectionandfDisconnectto skip nodes that are either already masternode connections or in a disconnecting stateThis prevents attempting to establish quorum connections to nodes that are disconnecting, which was the root cause of issue #6983.
42809cf to
5ec4651
Compare
PastaPastaPasta
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 5ec4651
5ec4651 to
0fce90a
Compare
Issue being fixed or feature implemented
Similar to #6983, incorrect refactoring in #6912
What was done?
Correctly detect and skip disconnecting pending quorum masternodes
How Has This Been Tested?
Run tests
Breaking Changes
n/a
Checklist: