@leofcoin/chain 1.7.147 → 1.7.149

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.
@@ -5906,8 +5906,11 @@ class Chain extends VersionControl {
5906
5906
  const higherThenCurrentLocal = !localBlock?.index ? true : lastBlock.index > localBlock.index;
5907
5907
  if (lastBlock) {
5908
5908
  if (!this.lastBlock || higherThenCurrentLocal) {
5909
- this.knownBlocks = await this.#makeRequest(peer, 'knownBlocks');
5910
- this.wantList.push(...this.knownBlocks);
5909
+ const knownBlocksResponse = await this.#makeRequest(peer, 'knownBlocks');
5910
+ if (knownBlocksResponse.blocks)
5911
+ for (const hash of knownBlocksResponse.blocks) {
5912
+ this.wantList.push(hash);
5913
+ }
5911
5914
  }
5912
5915
  }
5913
5916
  if (this.wantList.length > 0) {
package/exports/chain.js CHANGED
@@ -2046,8 +2046,11 @@ class Chain extends VersionControl {
2046
2046
  const higherThenCurrentLocal = !localBlock?.index ? true : lastBlock.index > localBlock.index;
2047
2047
  if (lastBlock) {
2048
2048
  if (!this.lastBlock || higherThenCurrentLocal) {
2049
- this.knownBlocks = await this.#makeRequest(peer, 'knownBlocks');
2050
- this.wantList.push(...this.knownBlocks);
2049
+ const knownBlocksResponse = await this.#makeRequest(peer, 'knownBlocks');
2050
+ if (knownBlocksResponse.blocks)
2051
+ for (const hash of knownBlocksResponse.blocks) {
2052
+ this.wantList.push(hash);
2053
+ }
2051
2054
  }
2052
2055
  }
2053
2056
  if (this.wantList.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/chain",
3
- "version": "1.7.147",
3
+ "version": "1.7.149",
4
4
  "description": "Official javascript implementation",
5
5
  "private": false,
6
6
  "exports": {