-
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
base: develop
Are you sure you want to change the base?
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 📒 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 |
9cde8d4 to
b6193ef
Compare
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 96febc3
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: