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