@leofcoin/chain 1.7.10 → 1.7.13

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.
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.13",
4
4
  "description": "Official javascript implementation",
5
5
  "private": false,
6
6
  "exports": {