diff --git a/service/p2p.go b/service/p2p.go index ead595b..0be9e83 100644 --- a/service/p2p.go +++ b/service/p2p.go @@ -205,7 +205,15 @@ func (p *P2PImpl) ConnectToNode(connectionUris []*url.URL, retried bool) error { } peer.SetId(id) - return p.OnNewPeer(peer, true) + + go func() { + err := p.OnNewPeer(peer, true) + if err != nil { + p.logger.Error("failed to add peer", zap.Error(err)) + } + }() + return nil + } func (p *P2PImpl) OnNewPeer(peer net.Peer, verifyId bool) error {