-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: adjust condition to detect suitable pending masternodes #6983
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
fix: adjust condition to detect suitable pending masternodes #6983
Conversation
✅ No Merge Conflicts DetectedThis PR currently has no conflicts with other open PRs. |
WalkthroughThe change updates CConnman::ThreadOpenMasternodeConnections in src/net.cpp to broaden when a pending masternode connection is opened. FindNode is now called with fExcludeDisconnecting=false to include disconnecting entries. A pending masternode connection is opened when either (a) no existing node entry is found for the target primary address (nullptr), or (b) an entry exists that is not a masternode_connection and is not disconnecting. Existing behavior of logging and returning the masternode candidate when no masternode connection is present is preserved. Sequence DiagramsequenceDiagram
participant ThreadOpenMasternodeConnections as Thread
participant FindNode
participant ConnectionLogic as ConnLogic
rect rgb(230,245,255)
Note over Thread,FindNode: Previous Behavior
Thread->>FindNode: FindNode(primary_address, fExcludeDisconnecting=true)
alt pnode != nullptr
FindNode-->>Thread: node found
Thread->>ConnLogic: if not masternode_connection -> attempt
alt Not masternode_connection
ConnLogic-->>Thread: Open pending masternode connection
else Already masternode_connection
ConnLogic-->>Thread: Skip
end
else pnode == nullptr
FindNode-->>Thread: nullptr
Thread->>ConnLogic: Skip attempt (no node entry)
end
end
rect rgb(245,230,255)
Note over Thread,FindNode: New Behavior
Thread->>FindNode: FindNode(primary_address, fExcludeDisconnecting=false)
alt pnode == nullptr
FindNode-->>Thread: nullptr
rect rgb(200,255,200)
Note over ConnLogic: NEW: proceed when no node entry
Thread->>ConnLogic: Open pending masternode connection
end
else pnode != nullptr
FindNode-->>Thread: node found (may be disconnecting)
Thread->>ConnLogic: if not masternode_connection AND not disconnecting -> attempt
alt Not masternode_connection AND not disconnecting
ConnLogic-->>Thread: Open pending masternode connection
else masternode_connection OR disconnecting
ConnLogic-->>Thread: Skip
end
end
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📥 CommitsReviewing files that changed from the base of the PR and between 9cde8d4b024822acae3bb596947912dfc498373f and 96febc30c8b626b1b7a58c80f2ab2534e90c5228. 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings⏰ 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)
🔇 Additional comments (1)
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 |
b6193ef to
96febc3
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 96febc30c8b626b1b7a58c80f2ab2534e90c5228
96febc3 to
b9310be
Compare
knst
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.
LGTM b9310be
…rum masternodes 0fce90a fix: correctly detect and skip disconnecting pending quorum masternodes (UdjinM6) Pull request description: ## 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: - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: kwvg: utACK 0fce90a Tree-SHA512: b92b2bf0d08bc814835a29333895c1328b0a12c6b7d612e980b59895d80f6c17ed9c228f65580cb10c0e1f1fd66304093a8224761525302782a3f19bae2a63f3
Issue being fixed or feature implemented
Mixing is broken on develop, mixing wallet can't connect to masternodes.
This condition was incorrectly refactored in #6912, https://github.com/dashpay/dash/pull/6912/files#diff-00021eed586a482abdb09d6cdada1d90115abe988a91421851960e26658bed02R3454-R3458.
What was done?
see commit
How Has This Been Tested?
Mixing works again
Breaking Changes
n/a
Checklist: