mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:42:38 +00:00
Banning a CJDNS peer from the Peers page does not take effect, and the entry is dropped at the next start #1124
Labels
No labels
Android
Bug
Build system
Design suggestion
Doc
Needs design review
Needs rebase
Stage
UX
Up for grabs
Upstream
Wallet
duplicate
enhancement
good first issue
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml#1124
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?
On a node where Core treats
fc00::/8as CJDNS, banning a CJDNS peer from the Peers page adds a row to the banned list but bans nothing: the peer stays connected, Core does not count the address as banned, and the entry is not loaded at the next start.To reproduce:
-cjdnsreachable=1and a proxy for CJDNS (-proxy=127.0.0.1:<port>=cjdns), and connect a peer withaddnode "[fc00::1]:18444" onetry.getpeerinfolists it with networkcjdns.[fc00::1]:18444row, then … in the details pane, 1 hour, and Ban.No error is shown, the footer reads "View 1 banned peer", and the list and
listbannedhavefc00::1/128. Compared with Core's own ban on the same node:setban fc00::1 add 3600getpeerinfoin 0.3 sdebug.logdisconnect by subnet=fc00::1 matchfc00::1/128fc00::1setban fc00::1 addlistbannedis[], the banned link is gone, log has "Dropping entry with unparseable address or subnet (fc00::1/128) from ban list"The result was the same in 2 offscreen runs and 1 native run, and offscreen at
eed1f426fcb6. The same clicks on a 127.0.0.1 peer under the same options banned and disconnected it, and that entry survived the restart.banPeergets the address as text and parses it again withLookupHost, which returns an IPv6 address, because a CJDNS address prints as plain IPv6 text:github.com/bitcoin-core/gui-qml@2bd5a61e83/qml/models/nodemodel.cpp (L918-L929)Core's
setbanappliesMaybeFlipIPv6toCJDNSafter the same lookup (rpc/net.cpp#L835-L839), and Bitcoin-Qt passes the peer's address object, by its source. The app's key is therefore an IPv6 /128 subnet, which never matches a CJDNS peer, and at start Core rejectsfc00::1/128because a CJDNS address cannot take a mask. By the same match an inbound connection from that address would be accepted; I did not observe that.The text round trip came in with #529, part of the work in closed #507; the first version of the action looked the peer up by node id. This belongs under #921. Open #985 rewrites
banPeerand keeps the sameLookupHostcall, so the fix could go there: pass the peer's address object, or applyMaybeFlipIPv6toCJDNSafter the lookup.Reach is small. CJDNS has to be enabled with a start-up option, which the app has no switch for, and
-onlynetmust not exclude it. The peer visibly stays in the list,setbanfrom the console works, and the app's Unban removes the stored row.Reproduced on
qt6at2bd5a61e8304, macOS arm64 / Qt 6.9.0, isolated regtest, offscreen and native. Limits:addnode.disconnectnodeby id removed it.