Skip to content

Commit

Permalink
fix(SwamController): remove peer ID from addresses in swarm/peers
Browse files Browse the repository at this point in the history
  • Loading branch information
richardschneider committed Jun 13, 2019
1 parent d1f85df commit 4bea391
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions IpfsServer/HttpApi/V0/SwamController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class ConnectedPeerDto
public ConnectedPeerDto(Peer peer)
{
Peer = peer.Id.ToString();
Addr = peer.ConnectedAddress?.ToString();
Addr = peer.ConnectedAddress?.WithoutPeerId().ToString();
Latency = peer.Latency == null ? string.Empty : Duration.Stringify(peer.Latency.Value, string.Empty);
}
}
Expand Down Expand Up @@ -97,7 +97,9 @@ public async Task<AddrsDto> PeerAddresses()
var dto = new AddrsDto();
foreach (var peer in peers)
{
dto.Addrs[peer.Id.ToString()] = peer.Addresses.Select(a => a.ToString()).ToList();
dto.Addrs[peer.Id.ToString()] = peer.Addresses
.Select(a => a.ToString())
.ToList();
}
return dto;
}
Expand Down

1 comment on commit 4bea391

@richardschneider
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes #117

Please sign in to comment.