fix: set the username to the peer id for all connection uris

This commit is contained in:
Derrick Hammer 2024-03-05 14:13:22 -05:00
parent 5fcf99d97e
commit 701386c05d
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 6 additions and 2 deletions

View File

@ -116,14 +116,18 @@ func (h HandshakeDone) HandleMessage(message IncomingMessageDataSigned) error {
return nil return nil
} }
peer.SetConnectionURIs(h.connectionUris)
peerId, err := peer.Id().ToString() peerId, err := peer.Id().ToString()
if err != nil { if err != nil {
return err return err
} }
for _, uri := range h.connectionUris {
uri.User = url.User(peerId)
}
peer.SetConnectionURIs(h.connectionUris)
logger.Info(fmt.Sprintf("[+] %s (%s)", peerId, peer.RenderLocationURI())) logger.Info(fmt.Sprintf("[+] %s (%s)", peerId, peer.RenderLocationURI()))
err = mediator.ConnectToNode([]*url.URL{h.connectionUris[0]}, false, peer) err = mediator.ConnectToNode([]*url.URL{h.connectionUris[0]}, false, peer)