@leofcoin/chain 1.5.17 → 1.5.18

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.
@@ -1528,9 +1528,10 @@ class State extends Contract {
1528
1528
  await globalThis.transactionPoolStore.delete(hash);
1529
1529
  console.log('removing invalid transaction');
1530
1530
  if (isExecutionError(error)) {
1531
- console.log('removing invalid block');
1531
+ console.log(`removing invalid block ${block.index}`);
1532
1532
  await globalThis.blockStore.delete(await (await new BlockMessage(block)).hash());
1533
- blocks.splice(block.index - 1, 1);
1533
+ const deletedBlock = blocks.splice(block.index, 1);
1534
+ console.log(`removed block ${deletedBlock[0].index}`);
1534
1535
  return this.#loadBlocks(blocks);
1535
1536
  }
1536
1537
  console.log(error);
package/exports/chain.js CHANGED
@@ -964,9 +964,10 @@ class State extends Contract {
964
964
  await globalThis.transactionPoolStore.delete(hash);
965
965
  console.log('removing invalid transaction');
966
966
  if (isExecutionError(error)) {
967
- console.log('removing invalid block');
967
+ console.log(`removing invalid block ${block.index}`);
968
968
  await globalThis.blockStore.delete(await (await new BlockMessage(block)).hash());
969
- blocks.splice(block.index - 1, 1);
969
+ const deletedBlock = blocks.splice(block.index, 1);
970
+ console.log(`removed block ${deletedBlock[0].index}`);
970
971
  return this.#loadBlocks(blocks);
971
972
  }
972
973
  console.log(error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/chain",
3
- "version": "1.5.17",
3
+ "version": "1.5.18",
4
4
  "description": "Official javascript implementation",
5
5
  "exports": {
6
6
  "./node": {