@leofcoin/chain 1.4.67 → 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;