@@ -7,7 +7,7 @@ import net from "net";
7
7
import { createSpinner } from "nanospinner" ;
8
8
import { MIN_HEIGHT , MIN_HEIGHT_HEADER_HASH } from "../utils/config" ;
9
9
import { Environment } from "../utils/Environment" ;
10
- import { DigCache } from "../utils " ;
10
+ import NodeCache from "node-cache " ;
11
11
import Bottleneck from "bottleneck" ;
12
12
13
13
const FULLNODE_PORT = 8444 ;
@@ -41,12 +41,12 @@ export class FullNodePeer {
41
41
private static instance : FullNodePeer | null = null ;
42
42
43
43
// Cooldown cache to exclude faulty peers temporarily
44
- private static cooldownCache = new DigCache ( {
44
+ private static cooldownCache = new NodeCache ( {
45
45
stdTTL : COOLDOWN_DURATION / 1000 ,
46
46
} ) ;
47
47
48
48
// Failed DNS hosts cooldown cache
49
- private static failedDNSCache = new DigCache ( { stdTTL : 86400 } ) ;
49
+ private static failedDNSCache = new NodeCache ( { stdTTL : 86400 } ) ;
50
50
51
51
// Peer reliability weights
52
52
private static peerWeights : Map < string , number > = new Map ( ) ;
@@ -58,10 +58,10 @@ export class FullNodePeer {
58
58
private static peerInfos : Map < string , PeerInfo > = new Map ( ) ;
59
59
60
60
// Cache for fetched peer IPs
61
- private static peerIPCache = new DigCache ( { stdTTL : CACHE_DURATION / 1000 } ) ;
61
+ private static peerIPCache = new NodeCache ( { stdTTL : CACHE_DURATION / 1000 } ) ;
62
62
63
63
// Cache for DNS_HOST resolved IPs with a TTL of 3 days (259200 seconds)
64
- private static dnsCache = new DigCache ( {
64
+ private static dnsCache = new NodeCache ( {
65
65
stdTTL : 259200 ,
66
66
checkperiod : 3600 ,
67
67
} ) ;
0 commit comments