@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.
- package/exports/browser/chain.js +5 -2
- package/exports/chain.js +5 -2
- package/package.json +1 -1
package/exports/browser/chain.js
CHANGED
|
@@ -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
|
-
|
|
5910
|
-
|
|
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
|
-
|
|
2050
|
-
|
|
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) {
|