hypercore 11.35.4 → 11.35.5
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/lib/core.js +10 -0
- package/package.json +1 -1
package/lib/core.js
CHANGED
|
@@ -154,6 +154,12 @@ module.exports = class Core {
|
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
this.opened = true
|
|
157
|
+
|
|
158
|
+
// always make sure we get an initial update
|
|
159
|
+
if (this.state.length === 0 && !isWritableHeader(this.header)) {
|
|
160
|
+
this.replicator.setDownloading(true)
|
|
161
|
+
this.replicator.setDownloading(false)
|
|
162
|
+
}
|
|
157
163
|
}
|
|
158
164
|
|
|
159
165
|
async _tryOpen(opts) {
|
|
@@ -1034,6 +1040,10 @@ async function maybeGetRootsFromStorage(storage, length) {
|
|
|
1034
1040
|
}
|
|
1035
1041
|
}
|
|
1036
1042
|
|
|
1043
|
+
function isWritableHeader(header) {
|
|
1044
|
+
return !!(header && header.keyPair && header.keyPair.secretKey)
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1037
1047
|
function noop() {}
|
|
1038
1048
|
|
|
1039
1049
|
async function getCoreInfo(storage) {
|