@leofcoin/chain 1.7.134 → 1.7.135

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.
@@ -4754,8 +4754,11 @@ class State extends Contract {
4754
4754
  });
4755
4755
  };
4756
4756
  this.#lastBlockHandler = async () => {
4757
+ const lastBlock = await this.lastBlock;
4758
+ // Don't advertise 0x0 as a valid block to other peers
4759
+ const response = lastBlock.hash !== '0x0' ? lastBlock : undefined;
4757
4760
  return new globalThis.peernet.protos['peernet-response']({
4758
- response: await this.lastBlock
4761
+ response
4759
4762
  });
4760
4763
  };
4761
4764
  this.#knownBlocksHandler = async () => {
package/exports/chain.js CHANGED
@@ -881,8 +881,11 @@ class State extends Contract {
881
881
  });
882
882
  };
883
883
  this.#lastBlockHandler = async () => {
884
+ const lastBlock = await this.lastBlock;
885
+ // Don't advertise 0x0 as a valid block to other peers
886
+ const response = lastBlock.hash !== '0x0' ? lastBlock : undefined;
884
887
  return new globalThis.peernet.protos['peernet-response']({
885
- response: await this.lastBlock
888
+ response
886
889
  });
887
890
  };
888
891
  this.#knownBlocksHandler = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/chain",
3
- "version": "1.7.134",
3
+ "version": "1.7.135",
4
4
  "description": "Official javascript implementation",
5
5
  "private": false,
6
6
  "exports": {