@leofcoin/chain 1.7.19 → 1.7.21

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.
@@ -5182,7 +5182,6 @@ class Chain extends VersionControl {
5182
5182
  // @ts-ignore
5183
5183
  .map(async (hash) => {
5184
5184
  const data = await peernet.get(hash, 'transaction');
5185
- transactionStore.put(hash, data);
5186
5185
  (await transactionPoolStore.has(hash)) && (await transactionPoolStore.delete(hash));
5187
5186
  return new TransactionMessage(data);
5188
5187
  }));
@@ -5276,8 +5275,10 @@ class Chain extends VersionControl {
5276
5275
  // if (timestamp + this.#slotTime > Date.now()) {
5277
5276
  try {
5278
5277
  const result = await this.#executeTransaction({ ...transaction.decoded, hash });
5279
- block.transactions.push(hash);
5280
- block.fees = block.fees.add(await calculateFee(transaction.decoded));
5278
+ if (block) {
5279
+ block.transactions.push(hash);
5280
+ block.fees = block.fees.add(await calculateFee(transaction.decoded));
5281
+ }
5281
5282
  await globalThis.accountsStore.put(transaction.decoded.from, new TextEncoder().encode(String(transaction.decoded.nonce)));
5282
5283
  await transactionStore.put(hash, await transaction.encode());
5283
5284
  }
package/exports/chain.js CHANGED
@@ -1549,7 +1549,6 @@ class Chain extends VersionControl {
1549
1549
  // @ts-ignore
1550
1550
  .map(async (hash) => {
1551
1551
  const data = await peernet.get(hash, 'transaction');
1552
- transactionStore.put(hash, data);
1553
1552
  (await transactionPoolStore.has(hash)) && (await transactionPoolStore.delete(hash));
1554
1553
  return new TransactionMessage(data);
1555
1554
  }));
@@ -1643,8 +1642,10 @@ class Chain extends VersionControl {
1643
1642
  // if (timestamp + this.#slotTime > Date.now()) {
1644
1643
  try {
1645
1644
  const result = await this.#executeTransaction({ ...transaction.decoded, hash });
1646
- block.transactions.push(hash);
1647
- block.fees = block.fees.add(await calculateFee(transaction.decoded));
1645
+ if (block) {
1646
+ block.transactions.push(hash);
1647
+ block.fees = block.fees.add(await calculateFee(transaction.decoded));
1648
+ }
1648
1649
  await globalThis.accountsStore.put(transaction.decoded.from, new TextEncoder().encode(String(transaction.decoded.nonce)));
1649
1650
  await transactionStore.put(hash, await transaction.encode());
1650
1651
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/chain",
3
- "version": "1.7.19",
3
+ "version": "1.7.21",
4
4
  "description": "Official javascript implementation",
5
5
  "private": false,
6
6
  "exports": {