From f1d2e14badfeb9eb61905b33b780ff82c2375ea8 Mon Sep 17 00:00:00 2001 From: pauldelucia Date: Tue, 27 Jan 2026 16:41:16 +0700 Subject: [PATCH 1/3] fix: ensure dev mode is off and spv sync off for new users --- .env.example | 3 --- src/app.rs | 4 ++-- src/database/initialization.rs | 4 ++-- src/database/settings.rs | 12 ++++++------ src/ui/network_chooser_screen.rs | 2 +- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.env.example b/.env.example index c7f0bb182..9e49c25c6 100644 --- a/.env.example +++ b/.env.example @@ -10,7 +10,6 @@ MAINNET_core_rpc_password=password MAINNET_insight_api_url=https://insight.dash.org/insight-api MAINNET_core_zmq_endpoint=tcp://127.0.0.1:23708 MAINNET_show_in_ui=true -MAINNET_developer_mode=true TESTNET_dapi_addresses=https://34.214.48.68:1443,https://52.12.176.90:1443,https://52.34.144.50:1443,https://44.240.98.102:1443,https://54.201.32.131:1443,https://52.10.229.11:1443,https://52.13.132.146:1443,https://52.40.219.41:1443,https://54.149.33.167:1443,https://35.164.23.245:1443,https://52.33.28.47:1443,https://52.43.13.92:1443,https://52.89.154.48:1443,https://52.24.124.162:1443,https://35.85.21.179:1443,https://54.187.14.232:1443,https://54.68.235.201:1443,https://52.13.250.182:1443 TESTNET_core_host=127.0.0.1 @@ -20,7 +19,6 @@ TESTNET_core_rpc_password=password TESTNET_insight_api_url=https://testnet-insight.dash.org/insight-api TESTNET_core_zmq_endpoint=tcp://127.0.0.1:23709 TESTNET_show_in_ui=true -TESTNET_developer_mode=false DEVNET_dapi_addresses=http://54.203.116.91:1443,http://52.88.16.46:1443,http://34.222.214.170:1443,http://54.214.77.108:1443,http://52.40.186.234:1443,http://54.202.231.20:1443,http://35.89.246.86:1443,http://18.246.227.21:1443,http://44.245.96.164:1443,http://44.247.160.52:1443 DEVNET_core_host=127.0.0.1 @@ -30,7 +28,6 @@ DEVNET_core_rpc_password=password DEVNET_insight_api_url= DEVNET_core_zmq_endpoint=tcp://127.0.0.1:23710 DEVNET_show_in_ui=true -DEVNET_developer_mode=false LOCAL_dapi_addresses=http://127.0.0.1:2443,http://127.0.0.1:2543,http://127.0.0.1:2643 LOCAL_core_host=127.0.0.1 diff --git a/src/app.rs b/src/app.rs index 2b7e4207e..cecc1a608 100644 --- a/src/app.rs +++ b/src/app.rs @@ -632,7 +632,7 @@ impl AppState { // TODO: SPV auto-start is gated behind developer mode while SPV is in development. // Remove the is_developer_mode() check once SPV is production-ready. let current_context = app_state.current_app_context(); - let auto_start_spv = db.get_auto_start_spv().unwrap_or(true); + let auto_start_spv = db.get_auto_start_spv().unwrap_or(false); if auto_start_spv && current_context.is_developer_mode() && current_context.core_backend_mode() == crate::spv::CoreBackendMode::Spv @@ -1081,7 +1081,7 @@ impl App for AppState { // TODO: SPV auto-start is gated behind developer mode while SPV is in development. // Remove the is_developer_mode() check once SPV is production-ready. let current_context = self.current_app_context(); - let auto_start_spv = current_context.db.get_auto_start_spv().unwrap_or(true); + let auto_start_spv = current_context.db.get_auto_start_spv().unwrap_or(false); if auto_start_spv && current_context.is_developer_mode() && current_context.core_backend_mode() == crate::spv::CoreBackendMode::Spv diff --git a/src/database/initialization.rs b/src/database/initialization.rs index 8581b6a90..929df4586 100644 --- a/src/database/initialization.rs +++ b/src/database/initialization.rs @@ -276,13 +276,13 @@ impl Database { overwrite_dash_conf INTEGER, disable_zmq INTEGER DEFAULT 0, theme_preference TEXT DEFAULT 'System', - core_backend_mode INTEGER DEFAULT 1, + core_backend_mode INTEGER DEFAULT 0, database_version INTEGER NOT NULL, onboarding_completed INTEGER DEFAULT 0, show_evonode_tools INTEGER DEFAULT 0, user_mode TEXT DEFAULT 'Advanced', use_local_spv_node INTEGER DEFAULT 0, - auto_start_spv INTEGER DEFAULT 1, + auto_start_spv INTEGER DEFAULT 0, close_dash_qt_on_exit INTEGER DEFAULT 1, selected_wallet_hash BLOB, selected_single_key_hash BLOB diff --git a/src/database/settings.rs b/src/database/settings.rs index d2cdd7055..b2e997f9d 100644 --- a/src/database/settings.rs +++ b/src/database/settings.rs @@ -363,7 +363,7 @@ impl Database { [], |row| row.get(0), )?; - Ok(result.unwrap_or(true)) // Default to true + Ok(result.unwrap_or(false)) // Default to false } /// Adds the close_dash_qt_on_exit column to the settings table. @@ -612,7 +612,7 @@ impl Database { overwrite_dash_conf.unwrap_or(true), disable_zmq.unwrap_or(false), theme_mode, - core_backend_mode.unwrap_or(1), // Default to SPV (1) + core_backend_mode.unwrap_or(0), // Default to RPC (0) onboarding_completed.unwrap_or(false), show_evonode_tools.unwrap_or(false), user_mode, @@ -796,18 +796,18 @@ mod tests { fn test_spv_settings() { let db = create_test_database().expect("Failed to create test database"); - // Test auto_start_spv (default true) + // Test auto_start_spv (default false) let auto_start = db .get_auto_start_spv() .expect("Failed to get auto_start_spv"); - assert!(auto_start); + assert!(!auto_start); - db.update_auto_start_spv(false) + db.update_auto_start_spv(true) .expect("Failed to update auto_start_spv"); let auto_start = db .get_auto_start_spv() .expect("Failed to get auto_start_spv"); - assert!(!auto_start); + assert!(auto_start); // Test use_local_spv_node (default false) let use_local = db diff --git a/src/ui/network_chooser_screen.rs b/src/ui/network_chooser_screen.rs index 8c0d54de9..527fafa98 100644 --- a/src/ui/network_chooser_screen.rs +++ b/src/ui/network_chooser_screen.rs @@ -107,7 +107,7 @@ impl NetworkChooserScreen { .db .get_use_local_spv_node() .unwrap_or(false); - let auto_start_spv = mainnet_app_context.db.get_auto_start_spv().unwrap_or(true); + let auto_start_spv = mainnet_app_context.db.get_auto_start_spv().unwrap_or(false); let close_dash_qt_on_exit = mainnet_app_context .db .get_close_dash_qt_on_exit() From 3d37facaa3d243aa9d71cae6ad65f964e6279c65 Mon Sep 17 00:00:00 2001 From: pauldelucia Date: Tue, 27 Jan 2026 17:15:55 +0700 Subject: [PATCH 2/3] fix tests --- src/database/initialization.rs | 2 +- src/database/settings.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/database/initialization.rs b/src/database/initialization.rs index 929df4586..02f747576 100644 --- a/src/database/initialization.rs +++ b/src/database/initialization.rs @@ -276,7 +276,7 @@ impl Database { overwrite_dash_conf INTEGER, disable_zmq INTEGER DEFAULT 0, theme_preference TEXT DEFAULT 'System', - core_backend_mode INTEGER DEFAULT 0, + core_backend_mode INTEGER DEFAULT 1, database_version INTEGER NOT NULL, onboarding_completed INTEGER DEFAULT 0, show_evonode_tools INTEGER DEFAULT 0, diff --git a/src/database/settings.rs b/src/database/settings.rs index b2e997f9d..6fc1184f2 100644 --- a/src/database/settings.rs +++ b/src/database/settings.rs @@ -612,7 +612,7 @@ impl Database { overwrite_dash_conf.unwrap_or(true), disable_zmq.unwrap_or(false), theme_mode, - core_backend_mode.unwrap_or(0), // Default to RPC (0) + core_backend_mode.unwrap_or(1), // Default to SPV (1) onboarding_completed.unwrap_or(false), show_evonode_tools.unwrap_or(false), user_mode, From b1bb28e903dbeb5399489c612bdab22a324e9c8b Mon Sep 17 00:00:00 2001 From: pauldelucia Date: Tue, 27 Jan 2026 17:21:21 +0700 Subject: [PATCH 3/3] fix --- src/database/settings.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/database/settings.rs b/src/database/settings.rs index 6fc1184f2..1853eeb4f 100644 --- a/src/database/settings.rs +++ b/src/database/settings.rs @@ -316,9 +316,9 @@ impl Database { )?; if !column_exists { - // Default to true - auto-start SPV on startup + // Default to false - don't auto-start SPV on startup conn.execute( - "ALTER TABLE settings ADD COLUMN auto_start_spv INTEGER DEFAULT 1;", + "ALTER TABLE settings ADD COLUMN auto_start_spv INTEGER DEFAULT 0;", (), )?; }