fix refresh random snode pool after getting new guardNodes

pull/1732/head
Audric Ackermann 3 years ago
parent ee3475f2be
commit ce9155a6bf
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -5,15 +5,15 @@
"contentProxyUrl": "",
"seedNodeList": [
{
"ip_url": "http://116.203.53.213:4433/",
"ip_url": "https://116.203.53.213:4433/",
"url": "https://storage.seed1.loki.network:4433/"
},
{
"ip_url": "http://212.199.114.66:4433/",
"ip_url": "https://212.199.114.66:4433/",
"url": "https://storage.seed3.loki.network:4433/"
},
{
"ip_url": "http://144.76.164.202:4433/",
"ip_url": "https://144.76.164.202:4433/",
"url": "https://public.loki.foundation:4433/"
}
],

@ -342,7 +342,7 @@ export async function selectGuardNodes(): Promise<Array<Snode>> {
async function buildNewOnionPathsWorker() {
window?.log?.info('LokiSnodeAPI::buildNewOnionPaths - building new onion paths...');
const allNodes = await SnodePool.getRandomSnodePool();
let allNodes = await SnodePool.getRandomSnodePool();
if (guardNodes.length === 0) {
// Not cached, load from DB
@ -369,7 +369,8 @@ async function buildNewOnionPathsWorker() {
// TODO: don't throw away potentially good guard nodes
guardNodes = await exports.selectGuardNodes();
}
// be sure to fetch again as that list might have been refreshed by selectGuardNodes
allNodes = await SnodePool.getRandomSnodePool();
// TODO: select one guard node and 2 other nodes randomly
let otherNodes = _.differenceBy(allNodes, guardNodes, 'pubkey_ed25519');
if (otherNodes.length < 2) {

Loading…
Cancel
Save