mirror of
https://github.com/hyprspace/hyprspace.git
synced 2026-09-12 19:51:07 +05:00
FindPeerByIDPrefix previously returned the first peer whose ID started with the given prefix, silently ignoring further matches. With Ed25519 peer IDs all sharing the leading "12D3KooW" (8 chars), short prefixes can match multiple peers; the chosen peer then depends on slice order, which is effectively undefined from the user's perspective. Change FindPeerByIDPrefix and its wrapper FindPeerByCLIRef to return (*Peer, error): - 0 matches -> (nil, nil) - 1 match -> (&peer, nil) - 2+ match -> (nil, error) describing the ambiguity Call sites in config.Read and rpc/server.go updated accordingly: ambiguity surfaces as a config-load / CLI error instead of a silent wrong-peer resolution. Not a wire-protocol or config-format change. Only behavior visible at CLI invocation and config load. Users relying on short prefixes that happened to match multiple peers will now see a clear error and must lengthen the prefix. |
||
|---|---|---|
| .. | ||
| config.go | ||
| idhash.go | ||