@leofcoin/chain 1.7.10 → 1.7.11

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.
@@ -4340,7 +4340,7 @@ class State extends Contract {
4340
4340
  * contains transactions we need before we can successfully load
4341
4341
  */
4342
4342
  get wantList() {
4343
- return this.#machine.wantList;
4343
+ return this.#machine.wantList ?? this._wantList;
4344
4344
  }
4345
4345
  get state() {
4346
4346
  return {
@@ -4403,6 +4403,7 @@ class State extends Contract {
4403
4403
  this.knownBlocks = [];
4404
4404
  this.#totalSize = 0;
4405
4405
  this.#loaded = false;
4406
+ this._wantList = [];
4406
4407
  this.#chainStateHandler = () => {
4407
4408
  return new globalThis.peernet.protos['peernet-response']({
4408
4409
  response: this.#chainState
@@ -4586,6 +4587,7 @@ class State extends Contract {
4586
4587
  if (this.#resolveErrorCount < 3)
4587
4588
  return this.resolveBlock(hash);
4588
4589
  this.#resolveErrorCount = 0;
4590
+ this.wantList.push(hash);
4589
4591
  throw new ResolveError(`block: ${hash}`, { cause: error });
4590
4592
  }
4591
4593
  }
package/exports/chain.js CHANGED
@@ -724,7 +724,7 @@ class State extends Contract {
724
724
  * contains transactions we need before we can successfully load
725
725
  */
726
726
  get wantList() {
727
- return this.#machine.wantList;
727
+ return this.#machine.wantList ?? this._wantList;
728
728
  }
729
729
  get state() {
730
730
  return {
@@ -787,6 +787,7 @@ class State extends Contract {
787
787
  this.knownBlocks = [];
788
788
  this.#totalSize = 0;
789
789
  this.#loaded = false;
790
+ this._wantList = [];
790
791
  this.#chainStateHandler = () => {
791
792
  return new globalThis.peernet.protos['peernet-response']({
792
793
  response: this.#chainState
@@ -970,6 +971,7 @@ class State extends Contract {
970
971
  if (this.#resolveErrorCount < 3)
971
972
  return this.resolveBlock(hash);
972
973
  this.#resolveErrorCount = 0;
974
+ this.wantList.push(hash);
973
975
  throw new ResolveError(`block: ${hash}`, { cause: error });
974
976
  }
975
977
  }
@@ -9,6 +9,7 @@ export default class State extends Contract {
9
9
  #private;
10
10
  knownBlocks: BlockHash[];
11
11
  jobber: Jobber;
12
+ _wantList: any[];
12
13
  /**
13
14
  * contains transactions we need before we can successfully load
14
15
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/chain",
3
- "version": "1.7.10",
3
+ "version": "1.7.11",
4
4
  "description": "Official javascript implementation",
5
5
  "private": false,
6
6
  "exports": {