File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
packages/portalnetwork/src/client Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -298,6 +298,10 @@ export class PortalNetwork extends EventEmitter<PortalNetworkEvents> {
298
298
await this . discv5 . start ( )
299
299
await this . db . open ( )
300
300
const storedIndex = await this . db . getBlockIndex ( )
301
+ const storedEnrCache = await this . db . get ( 'enr_cache' )
302
+ if ( storedEnrCache ) {
303
+ this . enrCache = new Map ( JSON . parse ( storedEnrCache ) )
304
+ }
301
305
for ( const network of this . networks . values ( ) ) {
302
306
try {
303
307
// Check for stored radius in db
@@ -334,6 +338,7 @@ export class PortalNetwork extends EventEmitter<PortalNetworkEvents> {
334
338
await this . discv5 . stop ( )
335
339
this . discv5 . removeAllListeners ( )
336
340
this . removeAllListeners ( )
341
+ await this . db . put ( 'enr_cache' , JSON . stringify ( [ ...this . enrCache . entries ( ) ] ) )
337
342
await this . db . close ( )
338
343
for ( const network of this . networks . values ( ) ) {
339
344
network . stopRefresh ( )
You can’t perform that action at this time.
0 commit comments