qt: Disconnect right-click action on Peers tab (Qt-only) #16
Labels
No labels
enhancement
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
SubGeniusFinance/Offerings-to-Cthulhu#16
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #13. Adds Disconnect Node to the right-click menu on the Peers tab.
Implementable as a pure-Qt change — no
net.cppmodifications needed because the existingCNode::CloseSocketDisconnect()API andfDisconnectflag (src/net.cpp:414) already do what's needed. IteratingvNodesundercs_vNodesfrom Qt code is the standard pattern.Freeze-cliff-safe:
Offeringsddoesn't linksrc/qt/*, so this can land any time.Why
Operator quality-of-life. When a peer is misbehaving — flooding
invs, hanging at the wrong tip, or just being slow — the wallet operator should be able to drop them in one click rather than scripting aroundOfferings-cli(which would need adisconnectnodeRPC that OFF doesn't currently have).For the Restoration window specifically: as the chain runs up to block 999,991, being able to drop the camped attacker's node from a wallet GUI is a low-friction defensive lever. The eviction lever via
MIN_PEER_PROTO_VERSION(see #12 / #15 protocol-version discussion) is the cluster-wide answer; this is the single-operator answer.Implementation
Builds on the right-click context-menu plumbing landed in #15 (Copy Address). After that issue lands, the menu construction is already there — this issue adds one more
QAction.src/qt/rpcconsole.h: declaredisconnectNode()slotsrc/qt/rpcconsole.cpp::setClientModel(): addDisconnect Nodeaction tocontextMenu, connect to slotsrc/qt/rpcconsole.cpp::disconnectNode():FindNode(NodeId)may not exist in OFF — verify; if missing, inline thevNodesiteration (4 lines).~30 LOC.
Trade-offs / What this isn't
disconnectnodeRPC would be a separate small follow-up if anyone wants it.Order of operations
Depends on #15 landing first (right-click menu plumbing). After #15 is merged, this is a ~30-min change.
Reference behavior
src/net.cpp:414::CNode::CloseSocketDisconnect— the existing disconnect APIsrc/net.cpp::vNodes— the connected-peer list, protected bycs_vNodesdobbscoin-source/src/qt/rpcconsole.cpp::disconnectNode— pattern to mirrorThe Slumbering Lord permits banishment of one Outsider at a time. Iä Iä.
Tested end-to-end on the merge commit (
7dc714d):Copy address+ a separator +Disconnect Node. Triggering Disconnect drops the connection — the row disappears from the table within a refresh tick once the socket-handler thread acts onfDisconnect.windows-build-depends.yml): same. Menu and disconnect behavior identical to Linux.Expected behavior: a disconnected peer can immediately reconnect via addrman — this is one-shot disconnect, not a ban. Permanent rejection requires the banlist module from #17 (post-Codex).
Closes on next sync via the
closes #16trailer in7dc714d.One Outsider banished. Iä Iä.