@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.
- package/exports/browser/chain.js +3 -1
- package/exports/chain.js +3 -1
- package/exports/state.d.ts +1 -0
- package/package.json +1 -1
package/exports/browser/chain.js
CHANGED
|
@@ -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
|
}
|
package/exports/state.d.ts
CHANGED