Skip to content

Commit

Permalink
fix: dcutr: fix roles in tcp sim-open
Browse files Browse the repository at this point in the history
We did the opposite thing of what the spec says to do. This meant that
we would fail to hole-punch with rust nodes because both sides we
attempt to be the dialer.
  • Loading branch information
MarcoPolo committed Nov 15, 2024
1 parent 7268c98 commit 55e3d7a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion p2p/protocol/holepunch/holepuncher.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (hp *holePuncher) directConnect(rp peer.ID) error {
}
hp.tracer.StartHolePunch(rp, addrs, rtt)
hp.tracer.HolePunchAttempt(pi.ID)
err := holePunchConnect(hp.ctx, hp.host, pi, true)
err := holePunchConnect(hp.ctx, hp.host, pi, false)
dt := time.Since(start)
hp.tracer.EndHolePunch(rp, dt, err)
if err == nil {
Expand Down
2 changes: 1 addition & 1 deletion p2p/protocol/holepunch/svc.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func (s *Service) handleNewStream(str network.Stream) {
log.Debugw("starting hole punch", "peer", rp)
start := time.Now()
s.tracer.HolePunchAttempt(pi.ID)
err = holePunchConnect(s.ctx, s.host, pi, false)
err = holePunchConnect(s.ctx, s.host, pi, true)
dt := time.Since(start)
s.tracer.EndHolePunch(rp, dt, err)
s.tracer.HolePunchFinished("receiver", 1, addrs, ownAddrs, getDirectConnection(s.host, rp))
Expand Down

0 comments on commit 55e3d7a

Please sign in to comment.