async _onConnect(peer) {
		const peerId = peer.toString();
		
		try {
			if (this.debug) {
				logT('p2p', 'Connected to peer:', peerId, 'peers:', this.size + 1);
			}

			if (!this.peers.has(peerId)) {
				// Get multiaddrs from the peer connection, not from our node
				const multiaddrs = [];
				try {
					// In newer libp2p versions, we need to get addresses from the peer connection
					const peerInfo = await this.node.peerStore.get(peer);
					if (peerInfo?.addresses) {
						multiaddrs.push(...peerInfo.addresses.map(addr => addr.multiaddr.toString()));
					}
				} catch (err) {
					if (this.debug) {
						logTW('p2p', 'Error getting peer multiaddrs:', err);
					}
				}

				const peerObject = {
					id: peerId,
					peer: peer,
					addresses: multiaddrs,
					connectedAt: Date.now(),
				}
				this.peers.set(peerId, peerObject);
				this.size++;

				// Check protocol compatibility
				if (!await this.sendProtocolCheck(peerId)) {
					this.peersNonProtocol.set(peerId, peerObject);
					this.peersNonProtocolSize++;
					return;
				} else {
					logT('p2p', 'Connected to protocol peer:', peerId, 'peers:', this.size + 1);
				}
				
				// Set a timeout to disconnect if protocol not verified
				setTimeout(() => {
					if (this.peers.has(peerId) && !this.peers.get(peerId)[this.protocolName]) {
						logTW('p2p', 'Protocol not verified within timeout, disconnecting peer:', peerId);
						this._disconnectPeer(peerId);
					}
				}, 10000); // 10 second timeout for protocol verification
			}
		} catch (err) {
			logTE('p2p', `Failed to dial protocol to peer ${peerId}:`, err.message);
			// If we couldn't establish a protocol stream, disconnect the peer
			this._disconnectPeer(peerId);
		}
	}
Handle peer connection
@param {Object} peer - Peer object