@leofcoin/chain 1.7.82 → 1.7.84

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.
@@ -4568,7 +4568,7 @@ class Machine {
4568
4568
  }
4569
4569
  async addLoadedBlock(block) {
4570
4570
  if (block.decoded)
4571
- block = { ...block.decoded, hahs: await block.hash() };
4571
+ block = { ...block.decoded, hash: await block.hash() };
4572
4572
  return this.#askWorker('addLoadedBlock', block);
4573
4573
  }
4574
4574
  async latestTransactions() {
@@ -5153,11 +5153,11 @@ class State extends Contract {
5153
5153
  transactions = transactions.filter((transaction) => !transaction.decoded.priority);
5154
5154
  await Promise.all(transactions.map((transaction) => this.#_executeTransaction(transaction)));
5155
5155
  this.#blocks[block.index].loaded = true;
5156
- if (block.index === 0)
5156
+ if (Number(block.index) === 0)
5157
5157
  this.#loaded = true;
5158
5158
  await this.#machine.addLoadedBlock(block);
5159
5159
  // @ts-ignore
5160
- debug$1(`loaded block: ${block.hash} @${block.index}`);
5160
+ debug$1(`loaded block: ${block.hash} @${Number(block.index)}`);
5161
5161
  globalThis.pubsub.publish('block-loaded', { ...block });
5162
5162
  }
5163
5163
  catch (error) {
@@ -1,4 +1,4 @@
1
- import { L as LittlePubSub } from './node-browser-Bgru0CmY.js';
1
+ import { L as LittlePubSub } from './node-browser-CsSAehTl.js';
2
2
  import './identity-Cn0iQbY3-CeW0giQS.js';
3
3
  import './index-DUfUgiQY.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { F as FormatInterface } from './node-browser-Bgru0CmY.js';
1
+ import { F as FormatInterface } from './node-browser-CsSAehTl.js';
2
2
  import './identity-Cn0iQbY3-CeW0giQS.js';
3
3
  import './index-DUfUgiQY.js';
4
4
 
@@ -8496,7 +8496,7 @@ class Peernet {
8496
8496
  this.root = options.root;
8497
8497
  const { RequestMessage, ResponseMessage, PeerMessage, PeerMessageResponse, PeernetMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PsMessage, ChatMessage, PeernetFile
8498
8498
  // FolderMessageResponse
8499
- } = await import(/* webpackChunkName: "messages" */ './messages-PrGKIaCz-DSaD3Nk1.js');
8499
+ } = await import(/* webpackChunkName: "messages" */ './messages-BYZZUpuv-MiKV0Pk4.js');
8500
8500
  /**
8501
8501
  * proto Object containing protos
8502
8502
  * @type {Object}
@@ -8590,7 +8590,7 @@ class Peernet {
8590
8590
  if (this.#starting || this.#started)
8591
8591
  return;
8592
8592
  this.#starting = true;
8593
- const importee = await import('./client-CWo3zJ1j-DAaJBi_R.js');
8593
+ const importee = await import('./client-Vbt0C3YZ-BSi2TKqM.js');
8594
8594
  /**
8595
8595
  * @access public
8596
8596
  * @type {PeernetClient}
@@ -8849,10 +8849,11 @@ class Peernet {
8849
8849
  debug(`Error while requesting data from ${id}`, error);
8850
8850
  // if error, remove provider
8851
8851
  this.dht.removeProvider(id, hash);
8852
- if (this.#peerAttempts[id] > 3) {
8852
+ if (this.#peerAttempts[id] > 1) {
8853
8853
  this.#peerAttempts[id] = 0;
8854
8854
  debug(`Removed provider ${id} for ${hash} after 3 attempts`);
8855
- throw nothingFoundError(hash);
8855
+ console.error(nothingFoundError(hash));
8856
+ return undefined;
8856
8857
  }
8857
8858
  if (this.#peerAttempts[id] === undefined)
8858
8859
  this.#peerAttempts[id] = 0;
@@ -1,3 +1,3 @@
1
- export { N as default } from './node-browser-Bgru0CmY.js';
1
+ export { N as default } from './node-browser-CsSAehTl.js';
2
2
  import './identity-Cn0iQbY3-CeW0giQS.js';
3
3
  import './index-DUfUgiQY.js';
package/exports/chain.js CHANGED
@@ -714,7 +714,7 @@ class Machine {
714
714
  }
715
715
  async addLoadedBlock(block) {
716
716
  if (block.decoded)
717
- block = { ...block.decoded, hahs: await block.hash() };
717
+ block = { ...block.decoded, hash: await block.hash() };
718
718
  return this.#askWorker('addLoadedBlock', block);
719
719
  }
720
720
  async latestTransactions() {
@@ -1299,11 +1299,11 @@ class State extends Contract {
1299
1299
  transactions = transactions.filter((transaction) => !transaction.decoded.priority);
1300
1300
  await Promise.all(transactions.map((transaction) => this.#_executeTransaction(transaction)));
1301
1301
  this.#blocks[block.index].loaded = true;
1302
- if (block.index === 0)
1302
+ if (Number(block.index) === 0)
1303
1303
  this.#loaded = true;
1304
1304
  await this.#machine.addLoadedBlock(block);
1305
1305
  // @ts-ignore
1306
- debug$1(`loaded block: ${block.hash} @${block.index}`);
1306
+ debug$1(`loaded block: ${block.hash} @${Number(block.index)}`);
1307
1307
  globalThis.pubsub.publish('block-loaded', { ...block });
1308
1308
  }
1309
1309
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/chain",
3
- "version": "1.7.82",
3
+ "version": "1.7.84",
4
4
  "description": "Official javascript implementation",
5
5
  "private": false,
6
6
  "exports": {
@@ -69,7 +69,7 @@
69
69
  "@leofcoin/messages": "^1.4.40",
70
70
  "@leofcoin/multi-wallet": "^3.1.8",
71
71
  "@leofcoin/networks": "^1.1.25",
72
- "@leofcoin/peernet": "^1.1.91",
72
+ "@leofcoin/peernet": "^1.1.92",
73
73
  "@leofcoin/storage": "^3.5.38",
74
74
  "@leofcoin/utils": "^1.1.39",
75
75
  "@leofcoin/workers": "^1.5.23",