@leofcoin/chain 1.7.129 → 1.7.130
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/exports/browser/chain.js +7 -1
- package/exports/chain.js +7 -1
- package/package.json +1 -1
package/exports/browser/chain.js
CHANGED
|
@@ -5478,6 +5478,11 @@ class ConnectionMonitor {
|
|
|
5478
5478
|
const connectedPeers = this.connectedPeers;
|
|
5479
5479
|
const compatiblePeers = this.compatiblePeers;
|
|
5480
5480
|
console.log(`🔍 Health check: ${connectedPeers.length} connected, ${compatiblePeers.length} compatible`);
|
|
5481
|
+
// If a reconnection is already ongoing, skip this cycle to avoid log spam/loops
|
|
5482
|
+
if (this.#reconnecting) {
|
|
5483
|
+
console.log('⏭️ Health check: reconnection already in progress, skipping reconnect attempt');
|
|
5484
|
+
return;
|
|
5485
|
+
}
|
|
5481
5486
|
// If we have no connections or none are compatible, try to reconnect
|
|
5482
5487
|
if (connectedPeers.length === 0) {
|
|
5483
5488
|
console.warn('⚠️ No peer connections detected — attempting reconnection');
|
|
@@ -5537,11 +5542,12 @@ class ConnectionMonitor {
|
|
|
5537
5542
|
console.log('🔁 Reconnection already in progress, skipping');
|
|
5538
5543
|
return;
|
|
5539
5544
|
}
|
|
5545
|
+
this.#reconnecting = true;
|
|
5540
5546
|
if (this.connectedPeers.length > 0) {
|
|
5541
5547
|
console.log('✅ Already connected to peers, skipping restoration');
|
|
5548
|
+
this.#reconnecting = false;
|
|
5542
5549
|
return;
|
|
5543
5550
|
}
|
|
5544
|
-
this.#reconnecting = true;
|
|
5545
5551
|
console.log('🔁 Restoring network');
|
|
5546
5552
|
try {
|
|
5547
5553
|
const online = await this.#isOnLine(1500);
|
package/exports/chain.js
CHANGED
|
@@ -1605,6 +1605,11 @@ class ConnectionMonitor {
|
|
|
1605
1605
|
const connectedPeers = this.connectedPeers;
|
|
1606
1606
|
const compatiblePeers = this.compatiblePeers;
|
|
1607
1607
|
console.log(`🔍 Health check: ${connectedPeers.length} connected, ${compatiblePeers.length} compatible`);
|
|
1608
|
+
// If a reconnection is already ongoing, skip this cycle to avoid log spam/loops
|
|
1609
|
+
if (this.#reconnecting) {
|
|
1610
|
+
console.log('⏭️ Health check: reconnection already in progress, skipping reconnect attempt');
|
|
1611
|
+
return;
|
|
1612
|
+
}
|
|
1608
1613
|
// If we have no connections or none are compatible, try to reconnect
|
|
1609
1614
|
if (connectedPeers.length === 0) {
|
|
1610
1615
|
console.warn('⚠️ No peer connections detected — attempting reconnection');
|
|
@@ -1664,11 +1669,12 @@ class ConnectionMonitor {
|
|
|
1664
1669
|
console.log('🔁 Reconnection already in progress, skipping');
|
|
1665
1670
|
return;
|
|
1666
1671
|
}
|
|
1672
|
+
this.#reconnecting = true;
|
|
1667
1673
|
if (this.connectedPeers.length > 0) {
|
|
1668
1674
|
console.log('✅ Already connected to peers, skipping restoration');
|
|
1675
|
+
this.#reconnecting = false;
|
|
1669
1676
|
return;
|
|
1670
1677
|
}
|
|
1671
|
-
this.#reconnecting = true;
|
|
1672
1678
|
console.log('🔁 Restoring network');
|
|
1673
1679
|
try {
|
|
1674
1680
|
const online = await this.#isOnLine(1500);
|