ChanMgr: Revise code to tolerate multiple identities
In order to support bridges, we need to have the ability to connect to a relay with a known RSA identity, but with no known Ed25519 identity. But currently, our ChanMgr
code assumes that every relay has an Ed25519 identity.
This branch solves that problem by changing the core type of ChannelMap
from HashMap<Ed25519Id, ChannelEntry>
to ByRelayIds<ChannelEntry>
. In doing so, it substantially simplifies the implementation of ChannelMap
itself.
There are some complications: Now it is possible to launch a Channel with only a known RSA identity, but complete the negotiation by authenticating both an RSA and an Ed25519 identity. Because of that, we need to handle a larger class of failures than previously, and we need to handle the case where we go to look up a channel, but find only a partial match. I've tried to comment these cases reasonably well.