@leofcoin/chain 1.5.48 → 1.5.51

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.
@@ -1,4 +1,4 @@
1
- import { g as getDefaultExportFromCjs } from './node-browser-DDilILXh.js';
1
+ import { g as getDefaultExportFromCjs } from './node-browser-cqEqYlW7.js';
2
2
  import './_polyfill-node.child_process-JsWeMPst.js';
3
3
 
4
4
  var global;
@@ -4760,9 +4760,8 @@ class Chain extends VersionControl {
4760
4760
  this.#jail = [];
4761
4761
  this.#addTransaction = async (message) => {
4762
4762
  const transaction = new TransactionMessage(message);
4763
- const hash = await transaction.hash();
4764
- if (await transactionPoolStore.has(hash))
4765
- await transactionPoolStore.delete(hash);
4763
+ await transaction.hash();
4764
+ // if (await transactionPoolStore.has(hash)) await transactionPoolStore.delete(hash)
4766
4765
  console.log(transaction);
4767
4766
  };
4768
4767
  // @ts-ignore
@@ -4940,7 +4939,12 @@ class Chain extends VersionControl {
4940
4939
  const blockMessage = await new BlockMessage(block);
4941
4940
  await Promise.all(blockMessage.decoded.transactions
4942
4941
  // @ts-ignore
4943
- .map(async (transaction) => transactionPoolStore.delete(transaction.hash)));
4942
+ .map(async (transaction) => {
4943
+ let hash = transaction.hash;
4944
+ if (!hash)
4945
+ await new TransactionMessage(transaction).hash();
4946
+ (await transactionPoolStore.has(hash)) && (await transactionPoolStore.delete(hash));
4947
+ }));
4944
4948
  const hash = await blockMessage.hash();
4945
4949
  await globalThis.blockStore.put(hash, blockMessage.encoded);
4946
4950
  if (this.lastBlock.index < Number(blockMessage.decoded.index))
@@ -1,4 +1,4 @@
1
- import { L as LittlePubSub } from './node-browser-DDilILXh.js';
1
+ import { L as LittlePubSub } from './node-browser-cqEqYlW7.js';
2
2
  import './_polyfill-node.child_process-JsWeMPst.js';
3
3
 
4
4
  class Api {
@@ -206,7 +206,7 @@ class SocketRequestClient {
206
206
  const init = async () => {
207
207
  // @ts-ignore
208
208
  if (!globalThis.WebSocket)
209
- globalThis.WebSocket = (await import('./browser-dc41c03f-jgWsLNN0.js').then(function (n) { return n.b; })).default.w3cwebsocket;
209
+ globalThis.WebSocket = (await import('./browser-dc41c03f-8RoAu8QY.js').then(function (n) { return n.b; })).default.w3cwebsocket;
210
210
  const client = new WebSocket(this.#url, this.#protocol);
211
211
  client.onmessage = this.onmessage;
212
212
  client.onerror = this.onerror;
@@ -280,7 +280,7 @@ const iceServers = [
280
280
  credential: 'openrelayproject'
281
281
  }
282
282
  ];
283
- const SimplePeer = (await import('./index-fd97ecae-IP8WPUJ5.js').then(function (n) { return n.i; })).default;
283
+ const SimplePeer = (await import('./index-fd97ecae-DMIypRPM.js').then(function (n) { return n.i; })).default;
284
284
  class Peer extends SimplePeer {
285
285
  peerId;
286
286
  channelName;
@@ -1,4 +1,4 @@
1
- import { M as MultiWallet, e as encrypt, b as base58$1 } from './node-browser-DDilILXh.js';
1
+ import { M as MultiWallet, e as encrypt, b as base58$1 } from './node-browser-cqEqYlW7.js';
2
2
  import './_polyfill-node.child_process-JsWeMPst.js';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { i as inherits_browserExports, c as commonjsGlobal, g as getDefaultExportFromCjs, r as require$$3 } from './node-browser-DDilILXh.js';
1
+ import { i as inherits_browserExports, c as commonjsGlobal, g as getDefaultExportFromCjs, r as require$$3 } from './node-browser-cqEqYlW7.js';
2
2
  import './_polyfill-node.child_process-JsWeMPst.js';
3
3
 
4
4
  var browser$2 = {exports: {}};
@@ -1,4 +1,4 @@
1
- import { F as FormatInterface } from './node-browser-DDilILXh.js';
1
+ import { F as FormatInterface } from './node-browser-cqEqYlW7.js';
2
2
  import './_polyfill-node.child_process-JsWeMPst.js';
3
3
 
4
4
  var proto$b = {
@@ -2,7 +2,6 @@ import { C as ContractMessage, T as TransactionMessage, B as BlockMessage, a as
2
2
 
3
3
  var nodeConfig = async (config = {
4
4
  network: 'leofcoin:peach',
5
- networkName: 'leofcoin:peach',
6
5
  networkVersion: 'v1.0.0'
7
6
  }) => {
8
7
  await peernet.addProto('contract-message', ContractMessage);
@@ -27182,7 +27181,7 @@ class Identity {
27182
27181
  this.selectedAccount = new TextDecoder().decode(selected);
27183
27182
  }
27184
27183
  else {
27185
- const importee = await import(/* webpackChunkName: "generate-account" */ './index-81687e93-b2xmOHmO.js');
27184
+ const importee = await import(/* webpackChunkName: "generate-account" */ './index-81687e93-rKzKdyEa.js');
27186
27185
  const { identity, accounts } = await importee.default(password, this.network);
27187
27186
  await globalThis.accountStore.put('public', JSON.stringify({ walletId: identity.walletId }));
27188
27187
  await globalThis.walletStore.put('version', String(1));
@@ -27373,7 +27372,7 @@ class Peernet {
27373
27372
  this.root = options.root;
27374
27373
  const { RequestMessage, ResponseMessage, PeerMessage, PeerMessageResponse, PeernetMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PsMessage, ChatMessage, PeernetFile
27375
27374
  // FolderMessageResponse
27376
- } = await import(/* webpackChunkName: "messages" */ './messages-cccb78db-oHb8zKmC.js');
27375
+ } = await import(/* webpackChunkName: "messages" */ './messages-cccb78db-bQaa1gST.js');
27377
27376
  /**
27378
27377
  * proto Object containing protos
27379
27378
  * @type {Object}
@@ -27467,7 +27466,7 @@ class Peernet {
27467
27466
  if (this.#starting || this.#started)
27468
27467
  return;
27469
27468
  this.#starting = true;
27470
- const importee = await import('./client-f193279c-PJq43OyI.js');
27469
+ const importee = await import('./client-f193279c-xoTAp1Bg.js');
27471
27470
  /**
27472
27471
  * @access public
27473
27472
  * @type {PeernetClient}
@@ -1,2 +1,2 @@
1
- export { N as default } from './node-browser-DDilILXh.js';
1
+ export { N as default } from './node-browser-cqEqYlW7.js';
2
2
  import './_polyfill-node.child_process-JsWeMPst.js';
package/exports/chain.js CHANGED
@@ -1171,9 +1171,8 @@ class Chain extends VersionControl {
1171
1171
  this.#jail = [];
1172
1172
  this.#addTransaction = async (message) => {
1173
1173
  const transaction = new TransactionMessage(message);
1174
- const hash = await transaction.hash();
1175
- if (await transactionPoolStore.has(hash))
1176
- await transactionPoolStore.delete(hash);
1174
+ await transaction.hash();
1175
+ // if (await transactionPoolStore.has(hash)) await transactionPoolStore.delete(hash)
1177
1176
  console.log(transaction);
1178
1177
  };
1179
1178
  // @ts-ignore
@@ -1351,7 +1350,12 @@ class Chain extends VersionControl {
1351
1350
  const blockMessage = await new BlockMessage(block);
1352
1351
  await Promise.all(blockMessage.decoded.transactions
1353
1352
  // @ts-ignore
1354
- .map(async (transaction) => transactionPoolStore.delete(transaction.hash)));
1353
+ .map(async (transaction) => {
1354
+ let hash = transaction.hash;
1355
+ if (!hash)
1356
+ await new TransactionMessage(transaction).hash();
1357
+ (await transactionPoolStore.has(hash)) && (await transactionPoolStore.delete(hash));
1358
+ }));
1355
1359
  const hash = await blockMessage.hash();
1356
1360
  await globalThis.blockStore.put(hash, blockMessage.encoded);
1357
1361
  if (this.lastBlock.index < Number(blockMessage.decoded.index))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/chain",
3
- "version": "1.5.48",
3
+ "version": "1.5.51",
4
4
  "description": "Official javascript implementation",
5
5
  "exports": {
6
6
  "./node": {