mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-21 06:18:42 +02:00
Cw 602 nano bad rep (#1356)
* add support for paths in node settings * update translations and fixes * fix node path * add rep warning flag * update translations * code cleanup [skip ci] * add additional node options * add migration * update transaction history rpc to be under the limit * review fixes [skip ci] * [skip ci] updates * move n2_node.dart * minor code improvements * more minor code cleanup
This commit is contained in:
@@ -216,6 +216,10 @@ Future<void> defaultSettingsMigration(
|
||||
await disableServiceStatusFiatDisabled(sharedPreferences);
|
||||
break;
|
||||
|
||||
case 31:
|
||||
await updateNanoNodeList(nodes: nodes);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -230,9 +234,35 @@ Future<void> defaultSettingsMigration(
|
||||
await sharedPreferences.setInt(PreferencesKey.currentDefaultSettingsMigrationVersion, version);
|
||||
}
|
||||
|
||||
Future<void> updateNanoNodeList({required Box<Node> nodes}) async {
|
||||
final nodeList = await loadDefaultNanoNodes();
|
||||
var listOfNewEndpoints = <String>[
|
||||
"app.natrium.io",
|
||||
"rainstorm.city",
|
||||
"node.somenano.com",
|
||||
"nanoslo.0x.no",
|
||||
"www.bitrequest.app",
|
||||
];
|
||||
// add new nodes:
|
||||
for (final node in nodeList) {
|
||||
if (listOfNewEndpoints.contains(node.uriRaw)) {
|
||||
await nodes.add(node);
|
||||
}
|
||||
}
|
||||
|
||||
// update the nautilus node:
|
||||
final nautilusNode =
|
||||
nodes.values.firstWhereOrNull((element) => element.uriRaw == "node.perish.co");
|
||||
if (nautilusNode != null) {
|
||||
nautilusNode.uriRaw = "node.nautilus.io";
|
||||
nautilusNode.path = "/api";
|
||||
nautilusNode.useSSL = true;
|
||||
await nautilusNode.save();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> disableServiceStatusFiatDisabled(SharedPreferences sharedPreferences) async {
|
||||
final currentFiat =
|
||||
await sharedPreferences.getInt(PreferencesKey.currentFiatApiModeKey) ?? -1;
|
||||
final currentFiat = await sharedPreferences.getInt(PreferencesKey.currentFiatApiModeKey) ?? -1;
|
||||
if (currentFiat == -1 || currentFiat == FiatApiMode.enabled.raw) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ class PreferencesKey {
|
||||
static const customBitcoinFeeRate = 'custom_electrum_fee_rate';
|
||||
static const shouldShowReceiveWarning = 'should_show_receive_warning';
|
||||
static const shouldShowYatPopup = 'should_show_yat_popup';
|
||||
static const shouldShowRepWarning = 'should_show_rep_warning';
|
||||
static const moneroWalletPasswordUpdateV1Base = 'monero_wallet_update_v1';
|
||||
static const syncModeKey = 'sync_mode';
|
||||
static const syncAllKey = 'sync_all';
|
||||
|
||||
Reference in New Issue
Block a user