@leofcoin/chain 1.7.75 → 1.7.76
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
CHANGED
|
@@ -5314,10 +5314,10 @@ class ConnectionMonitor {
|
|
|
5314
5314
|
return this.connectedPeers.filter((peer) => peer.version === this.#version);
|
|
5315
5315
|
}
|
|
5316
5316
|
constructor(version) {
|
|
5317
|
-
this.#version = version;
|
|
5318
5317
|
console.log(`🔗 Connection Monitor initialized for version: ${this.#version}`);
|
|
5319
5318
|
}
|
|
5320
|
-
start() {
|
|
5319
|
+
start(version) {
|
|
5320
|
+
this.#version = version;
|
|
5321
5321
|
if (this.#isMonitoring)
|
|
5322
5322
|
return;
|
|
5323
5323
|
this.#isMonitoring = true;
|
|
@@ -5505,7 +5505,7 @@ class Chain extends VersionControl {
|
|
|
5505
5505
|
// this.node = await new Node()
|
|
5506
5506
|
this.#participants = [];
|
|
5507
5507
|
this.#participating = false;
|
|
5508
|
-
this.#connectionMonitor = new ConnectionMonitor(
|
|
5508
|
+
this.#connectionMonitor = new ConnectionMonitor();
|
|
5509
5509
|
const initialized = await globalThis.contractStore.has(addresses.contractFactory);
|
|
5510
5510
|
if (!initialized)
|
|
5511
5511
|
await this.#setup();
|
|
@@ -5514,7 +5514,7 @@ class Chain extends VersionControl {
|
|
|
5514
5514
|
// todo some functions rely on state
|
|
5515
5515
|
await super.init();
|
|
5516
5516
|
// Start connection monitoring
|
|
5517
|
-
this.#connectionMonitor.start();
|
|
5517
|
+
this.#connectionMonitor.start(this.version);
|
|
5518
5518
|
await globalThis.peernet.addRequestHandler('bw-request-message', () => {
|
|
5519
5519
|
const bw = globalThis.peernet.client?.bw || { up: 0, down: 0 };
|
|
5520
5520
|
return new BWMessage(bw);
|
package/exports/chain.js
CHANGED
|
@@ -1460,10 +1460,10 @@ class ConnectionMonitor {
|
|
|
1460
1460
|
return this.connectedPeers.filter((peer) => peer.version === this.#version);
|
|
1461
1461
|
}
|
|
1462
1462
|
constructor(version) {
|
|
1463
|
-
this.#version = version;
|
|
1464
1463
|
console.log(`🔗 Connection Monitor initialized for version: ${this.#version}`);
|
|
1465
1464
|
}
|
|
1466
|
-
start() {
|
|
1465
|
+
start(version) {
|
|
1466
|
+
this.#version = version;
|
|
1467
1467
|
if (this.#isMonitoring)
|
|
1468
1468
|
return;
|
|
1469
1469
|
this.#isMonitoring = true;
|
|
@@ -1651,7 +1651,7 @@ class Chain extends VersionControl {
|
|
|
1651
1651
|
// this.node = await new Node()
|
|
1652
1652
|
this.#participants = [];
|
|
1653
1653
|
this.#participating = false;
|
|
1654
|
-
this.#connectionMonitor = new ConnectionMonitor(
|
|
1654
|
+
this.#connectionMonitor = new ConnectionMonitor();
|
|
1655
1655
|
const initialized = await globalThis.contractStore.has(addresses.contractFactory);
|
|
1656
1656
|
if (!initialized)
|
|
1657
1657
|
await this.#setup();
|
|
@@ -1660,7 +1660,7 @@ class Chain extends VersionControl {
|
|
|
1660
1660
|
// todo some functions rely on state
|
|
1661
1661
|
await super.init();
|
|
1662
1662
|
// Start connection monitoring
|
|
1663
|
-
this.#connectionMonitor.start();
|
|
1663
|
+
this.#connectionMonitor.start(this.version);
|
|
1664
1664
|
await globalThis.peernet.addRequestHandler('bw-request-message', () => {
|
|
1665
1665
|
const bw = globalThis.peernet.client?.bw || { up: 0, down: 0 };
|
|
1666
1666
|
return new BWMessage(bw);
|
|
@@ -7,7 +7,7 @@ export default class ConnectionMonitor {
|
|
|
7
7
|
get connectedPeers(): import("@netpeer/swarm/peer").default[];
|
|
8
8
|
get compatiblePeers(): import("@netpeer/swarm/peer").default[];
|
|
9
9
|
constructor(version: string);
|
|
10
|
-
start(): void;
|
|
10
|
+
start(version: any): void;
|
|
11
11
|
stop(): void;
|
|
12
12
|
waitForPeers(timeoutMs?: number): Promise<boolean>;
|
|
13
13
|
}
|