Skip to content

Commit

Permalink
Merge pull request #1075 from coryschwartz/feat/fix-go-vet
Browse files Browse the repository at this point in the history
fix go vet
  • Loading branch information
marten-seemann authored Apr 20, 2021
2 parents 3ef2f76 + 628f86c commit 6a5da01
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions p2p/host/basic/basic_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,10 @@ func NewHost(ctx context.Context, n network.Network, opts *HostOpts) (*BasicHost
}

// persist a signed peer record for self to the peerstore.
rec := peer.PeerRecordFromAddrInfo(peer.AddrInfo{h.ID(), h.Addrs()})
rec := peer.PeerRecordFromAddrInfo(peer.AddrInfo{
ID: h.ID(),
Addrs: h.Addrs(),
})
ev, err := record.Seal(rec, h.signKey)
if err != nil {
return nil, fmt.Errorf("failed to create signed record for self: %w", err)
Expand Down Expand Up @@ -467,7 +470,10 @@ func (h *BasicHost) makeSignedPeerRecord(evt *event.EvtLocalAddressesUpdated) (*
current = append(current, a.Address)
}

rec := peer.PeerRecordFromAddrInfo(peer.AddrInfo{h.ID(), current})
rec := peer.PeerRecordFromAddrInfo(peer.AddrInfo{
ID: h.ID(),
Addrs: current,
})
return record.Seal(rec, h.signKey)
}

Expand Down

0 comments on commit 6a5da01

Please sign in to comment.