Change default haven node to nodes.havenprotocol.org:443

This commit is contained in:
M 2022-05-18 17:13:58 +01:00
parent 08ffaaa69f
commit aacc9014ea
3 changed files with 18 additions and 5 deletions

View file

@ -1,6 +1,4 @@
-
uri: vault.havenprotocol.org:443
login: super
password: super
uri: nodes.havenprotocol.org:443
useSSL: true
is_default: true

View file

@ -22,7 +22,7 @@ import 'package:encrypt/encrypt.dart' as encrypt;
const newCakeWalletMoneroUri = 'xmr-node.cakewallet.com:18081';
const cakeWalletBitcoinElectrumUri = 'electrum.cakewallet.com:50002';
const cakeWalletLitecoinElectrumUri = 'ltc-electrum.cakewallet.com:50002';
const havenDefaultNodeUri = 'vault.havenprotocol.org:443';
const havenDefaultNodeUri = 'nodes.havenprotocol.org:443';
Future defaultSettingsMigration(
{@required int version,
@ -128,6 +128,10 @@ Future defaultSettingsMigration(
await checkCurrentNodes(nodes, sharedPreferences);
break;
case 17:
await changeDefaultHavenNode(nodes);
break;
default:
break;
}
@ -452,3 +456,14 @@ Future<void> resetBitcoinElectrumServer(
await oldElectrumServer?.delete();
}
Future<void> changeDefaultHavenNode(
Box<Node> nodeSource) async {
const previousHavenDefaultNodeUri = 'vault.havenprotocol.org:443';
final havenNodes = nodeSource.values.where(
(node) => node.uriRaw == previousHavenDefaultNodeUri);
havenNodes.forEach((node) async {
node.uriRaw = havenDefaultNodeUri;
await node.save();
});
}

View file

@ -126,7 +126,7 @@ Future<void> main() async {
exchangeTemplates: exchangeTemplates,
transactionDescriptions: transactionDescriptions,
secureStorage: secureStorage,
initialMigrationVersion: 16);
initialMigrationVersion: 17);
runApp(App());
} catch (e) {
runApp(MaterialApp(