@leofcoin/chain 1.4.68 → 1.4.69

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.
@@ -8267,14 +8267,15 @@ class Chain extends Contract {
8267
8267
  if (!peer.version || peer.version !== this.version)
8268
8268
  return;
8269
8269
  const lastBlock = await this.#makeRequest(peer, 'lastBlock');
8270
- if (this.#resolveErrored || lastBlock && lastBlock.index > this.#lastBlock?.index) {
8271
- // this.#knownBlocks = await this.#makeRequest(peer, 'knownBlocks')
8272
- console.log(lastBlock);
8273
- this.#resolveErrored = false;
8274
- if (lastBlock)
8275
- await this.syncChain(lastBlock);
8276
- if (await this.hasTransactionToHandle() && !this.#resolveErrored && this.#participating)
8277
- this.#runEpoch();
8270
+ if (Object.keys(lastBlock).length > 0) {
8271
+ if (this.#resolveErrored || lastBlock && lastBlock.index > this.#lastBlock?.index) {
8272
+ // this.#knownBlocks = await this.#makeRequest(peer, 'knownBlocks')
8273
+ this.#resolveErrored = false;
8274
+ if (lastBlock)
8275
+ await this.syncChain(lastBlock);
8276
+ if (await this.hasTransactionToHandle() && !this.#resolveErrored && this.#participating)
8277
+ this.#runEpoch();
8278
+ }
8278
8279
  }
8279
8280
  }
8280
8281
  #epochTimeout;
package/exports/chain.js CHANGED
@@ -853,14 +853,15 @@ class Chain extends Contract {
853
853
  if (!peer.version || peer.version !== this.version)
854
854
  return;
855
855
  const lastBlock = await this.#makeRequest(peer, 'lastBlock');
856
- if (this.#resolveErrored || lastBlock && lastBlock.index > this.#lastBlock?.index) {
857
- // this.#knownBlocks = await this.#makeRequest(peer, 'knownBlocks')
858
- console.log(lastBlock);
859
- this.#resolveErrored = false;
860
- if (lastBlock)
861
- await this.syncChain(lastBlock);
862
- if (await this.hasTransactionToHandle() && !this.#resolveErrored && this.#participating)
863
- this.#runEpoch();
856
+ if (Object.keys(lastBlock).length > 0) {
857
+ if (this.#resolveErrored || lastBlock && lastBlock.index > this.#lastBlock?.index) {
858
+ // this.#knownBlocks = await this.#makeRequest(peer, 'knownBlocks')
859
+ this.#resolveErrored = false;
860
+ if (lastBlock)
861
+ await this.syncChain(lastBlock);
862
+ if (await this.hasTransactionToHandle() && !this.#resolveErrored && this.#participating)
863
+ this.#runEpoch();
864
+ }
864
865
  }
865
866
  }
866
867
  #epochTimeout;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/chain",
3
- "version": "1.4.68",
3
+ "version": "1.4.69",
4
4
  "description": "Official javascript implementation",
5
5
  "exports": {
6
6
  "./node": "./exports/node.js",