@leofcoin/chain 1.4.64 → 1.4.66
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 +4 -7
- package/exports/browser/client-7b9cd236-6d716d62.js +9425 -0
- package/exports/browser/{index-d89d21c8-48afef1d.js → index-3335f096-9107fef9.js} +1 -1
- package/exports/browser/{messages-865446ee-90970bdb.js → messages-56ff4da4-d9fa0d76.js} +1 -1
- package/exports/browser/{node-browser-4e3729e3.js → node-browser-8efb8048.js} +19 -13
- package/exports/browser/node-browser.js +1 -1
- package/exports/chain.js +4 -7
- package/exports/typings/chain.d.ts +1 -1
- package/package.json +1 -1
- package/exports/browser/client-6167d247-17f75c67.js +0 -41107
package/exports/browser/chain.js
CHANGED
|
@@ -8178,11 +8178,8 @@ class Chain extends Contract {
|
|
|
8178
8178
|
this.#jail.push(validatorInfo.address);
|
|
8179
8179
|
}
|
|
8180
8180
|
async triggerSync() {
|
|
8181
|
-
if (this.#chainSyncing)
|
|
8182
|
-
return 'already syncing';
|
|
8183
8181
|
const latest = await this.#getLatestBlock();
|
|
8184
|
-
|
|
8185
|
-
return 'synced';
|
|
8182
|
+
return this.syncChain(latest);
|
|
8186
8183
|
}
|
|
8187
8184
|
async syncChain(lastBlock) {
|
|
8188
8185
|
if (!lastBlock)
|
|
@@ -8215,8 +8212,6 @@ class Chain extends Contract {
|
|
|
8215
8212
|
return 'connectionless';
|
|
8216
8213
|
try {
|
|
8217
8214
|
await syncPromise(lastBlock);
|
|
8218
|
-
if (lastBlock.index === this.#lastBlockInQue?.index || lastBlock.index > this.#lastBlockInQue?.index)
|
|
8219
|
-
this.#lastBlockInQue = undefined;
|
|
8220
8215
|
}
|
|
8221
8216
|
catch (error) {
|
|
8222
8217
|
console.log(error);
|
|
@@ -8227,10 +8222,12 @@ class Chain extends Contract {
|
|
|
8227
8222
|
this.#syncErrorCount = 0;
|
|
8228
8223
|
return 'errored';
|
|
8229
8224
|
}
|
|
8225
|
+
if (lastBlock.index === this.#lastBlockInQue?.index)
|
|
8226
|
+
this.#lastBlockInQue = undefined;
|
|
8230
8227
|
this.#syncErrorCount = 0;
|
|
8228
|
+
this.#chainSyncing = false;
|
|
8231
8229
|
if (this.#lastBlockInQue)
|
|
8232
8230
|
return this.syncChain(this.#lastBlockInQue);
|
|
8233
|
-
this.#chainSyncing = false;
|
|
8234
8231
|
return 'synced';
|
|
8235
8232
|
}
|
|
8236
8233
|
async #syncChain(lastBlock) {
|