Fix CI after bumping `bitcoin` dependency (#1226)
What changed, and why it matters
This is a routine code cleanup to fix a Rust compiler error after upgrading the `bitcoin` library. The old code had a catch-all branch for unknown Bitcoin networks that printed an error and exited. The new version of the `bitcoin` library no longer allows that extra branch, so the developer removed it. There is no security issue here—just making the project compile again.
No security action required. Treat as normal maintenance/dependency update follow-up.
Security signals we found
No security-relevant change identified
Change is a build/compilation fix only
Removed unreachable catch-all match arms
Evidence from the diff
The commit removes an unsupported_network helper and its catch-all unsupported => unsupported_network(unsupported) arms from several match statements on bitcoin::Network. After bumping the bitcoin dependency, the Network enum is likely exhaustive (or the compiler rejects unreachable patterns), causing CI failures. The patch deletes the now-invalid/unreachable branches. No behavior change for known networks; the program will now rely on the compiler-enforced exhaustiveness of the enum instead of a runtime exit for unknown variants.
Changed components
src/config.rsInspect captured patch +0 / −11
diff --git a/src/config.rs b/src/config.rs
index c7fd392..230d84b 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -198,18 +198,12 @@ impl Config {
internal::prelude::Config::including_optional_config_files(default_config_files())
.unwrap_or_exit();
- fn unsupported_network(network: Network) -> ! {
- eprintln!("Error: unsupported network: {}", network);
- std::process::exit(1);
- }
-
let db_subdir = match config.network {
Network::Bitcoin => "bitcoin",
Network::Testnet => "testnet",
Network::Testnet4 => "testnet4",
Network::Regtest => "regtest",
Network::Signet => "signet",
- unsupported => unsupported_network(unsupported),
};
config.db_dir.push(db_subdir);
@@ -220,7 +214,6 @@ impl Config {
Network::Testnet4 => 48332,
Network::Regtest => 18443,
Network::Signet => 38332,
- unsupported => unsupported_network(unsupported),
};
let default_daemon_p2p_port = match config.network {
Network::Bitcoin => 8333,
@@ -228,7 +221,6 @@ impl Config {
Network::Testnet4 => 48333,
Network::Regtest => 18444,
Network::Signet => 38333,
- unsupported => unsupported_network(unsupported),
};
let default_electrum_port = match config.network {
Network::Bitcoin => 50001,
@@ -236,7 +228,6 @@ impl Config {
Network::Testnet4 => 40001,
Network::Regtest => 60401,
Network::Signet => 60601,
- unsupported => unsupported_network(unsupported),
};
let default_monitoring_port = match config.network {
Network::Bitcoin => 4224,
@@ -244,7 +235,6 @@ impl Config {
Network::Testnet4 => 44224,
Network::Regtest => 24224,
Network::Signet => 34224,
- unsupported => unsupported_network(unsupported),
};
let magic = match (config.network, config.signet_magic) {
@@ -292,7 +282,6 @@ impl Config {
Network::Testnet4 => config.daemon_dir.push("testnet4"),
Network::Regtest => config.daemon_dir.push("regtest"),
Network::Signet => config.daemon_dir.push("signet"),
- unsupported => unsupported_network(unsupported),
}
let mut deprecated_options_used = false;
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.