async _attemptConnection(peer, options = {}) {
		if (this.closing) {
			logTW('p2p', 'Not connecting to peer', peer, 'because node is closing');
			return;
		}

		if (!peer) {
			logTE('p2p', 'No peer provided for connection attempt');
			return;
		}

		const isProtocolPeer = peer.protocol || options.protocol || peer[this.protocolName];

		if (!await this._managePeerPool({ protocol: isProtocolPeer })) {
			if (this.debug) {
				logTW('p2p', 'Not connecting to peer', peer, 'because of peer pool management');
			}
			return;
		}
		
		let dialTarget = null;
		
		// Case 1: It's a libp2p peer object with _peerId
		if (this.isPeerId(peer)) {
			dialTarget = peer;
		} 
		// Case 2: It's our own object format with id and possibly addresses
		else if (peer.id) {
			try {
				// If peer.id is a string PeerId, use it directly
				dialTarget = peer.id;
				
				// If we have addresses, create multiaddrs for dialing
				if (peer.addresses && Array.isArray(peer.addresses) && peer.addresses.length > 0) {
					// For peer objects with addresses array, create multiaddrs
					const addresses = peer.addresses.map(addr => {
						// If address is already a multiaddr, use it directly
						if (typeof addr === 'object') return addr;
						// Otherwise create a new multiaddr from string
						return this.multiaddr(addr);
					});
					
					// If there are addresses, use array of multiaddrs
					if (addresses.length > 0) {
						dialTarget = addresses;
					}
				}
			} catch (err) {
				logTE('p2p', 'Error creating multiaddr for peer', peer.id, err.message);
			}
		}

		// If we couldn't create a valid dialTarget, log and return
		if (!dialTarget) {
			logTE('p2p', 'Could not create a valid dial target from peer', peer);
			return;
		}

		if (this.debug) {
			logT('p2p', 'Attempt connection to', dialTarget);
		}

		try {
			await this.node.dial(dialTarget);
		} catch (err) {
			if (this.debug) {
				logTE('p2p', 'Failed to connect to discovered peer', dialTarget, err.message, peer);
			}
		}
	}
Attempt connection to a discovered peer
@param {Object} peer - Peer to connect to
@param {Object} options - Options
@param {boolean} options.protocol - Connect to protocol peer
@returns {Promise<void>}