Skip to content

Commit b7bffe0

Browse files
authored
Call ensureConnection in PeerID to ensure we have fetched the certs (… (#189)
1 parent 2b7728a commit b7bffe0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pkg/peerprotocol/connection.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,13 @@ func (c *Connection) Close() {
167167
}
168168

169169
// PeerID returns the Peer ID for the remote peer
170-
func (c *Connection) PeerID() types.Bytes32 {
171-
return c.peerID
170+
func (c *Connection) PeerID() (types.Bytes32, error) {
171+
err := c.ensureConnection()
172+
if err != nil {
173+
return types.Bytes32{}, err
174+
}
175+
176+
return c.peerID, nil
172177
}
173178

174179
// Handshake performs the RPC handshake. This should be called before any other method

0 commit comments

Comments
 (0)