Attempt to stabilize channel reconnecting
This commit is contained in:
@@ -1306,9 +1306,14 @@ function performHealthCheck() {
|
||||
const peerChannel = channelInfo.peerChannels?.get(peerId);
|
||||
if (!peerChannel) {
|
||||
// Peer is connected but missing this channel - create it
|
||||
logDebug('ChannelManager', `Peer ${peerId.substring(0, 16)}... connected but missing channel ${pluginDomain}-${protocol}, creating it`);
|
||||
const isReconnection = state.peerHistory?.get(peerId)?.some(event => event.type === 'connect') || false;
|
||||
const reconnectionNote = isReconnection ? ' (reconnection)' : '';
|
||||
logDebug('ChannelManager', `Peer ${peerId.substring(0, 16)}... connected but missing channel ${pluginDomain}-${protocol}${reconnectionNote}, creating it`);
|
||||
try {
|
||||
createPluginChannelsForPeer(peerId, peerChannelInfo.conn, peerChannelInfo.mux);
|
||||
if (isReconnection) {
|
||||
logInfo('ChannelManager', `Successfully recreated missing channel ${pluginDomain}-${protocol} for reconnected peer ${peerId.substring(0, 16)}...`);
|
||||
}
|
||||
} catch (err) {
|
||||
logError('ChannelManager', `Error creating missing channel for peer ${peerId.substring(0, 16)}...: ${err.message}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user