Skip to content

Commit

Permalink
only override users who have not changed peers
Browse files Browse the repository at this point in the history
  • Loading branch information
nitesh authored and nitesh committed Jun 14, 2024
1 parent 8105c86 commit e96f7b4
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/migration/app-migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,20 @@ export const appMigration: IAppMigration[] = [
{
async beforeLnd(db, i) {
if (Chain === "mainnet") {
// Override current neutrino peers
await setItemObject<string[]>(StorageItem.neutrinoPeers, DEFAULT_NEUTRINO_NODE);
const oldPeers = [
"node.blixtwallet.com",
"btcd.lnolymp.us",
"neutrino.noderunner.wtf",
"node.eldamar.icu",
"btcd-mainnet.lightning.computer",
].join(",");

const userPeers = (await getItemObject<string[]>(StorageItem.neutrinoPeers)).join(",");

// Override current neutrino peers if the users have not changed their nodes
if (oldPeers === userPeers) {
await setItemObject<string[]>(StorageItem.neutrinoPeers, DEFAULT_NEUTRINO_NODE);
}
}
},
},
Expand Down

0 comments on commit e96f7b4

Please sign in to comment.