(config: &Config)
| 681 | } |
| 682 | |
| 683 | fn get_cookie(config: &Config) -> Option<path::PathBuf> { |
| 684 | let mut dir = config.bitcoind_dir.clone().or_else(bitcoind_default_dir)?; |
| 685 | match config.network { |
| 686 | Network::Bitcoin => (), |
| 687 | Network::Testnet => dir.push("testnet3"), |
| 688 | Network::Regtest => dir.push("regtest"), |
| 689 | Network::Signet => dir.push("signet"), |
| 690 | } |
| 691 | let cookie = dir.join(".cookie"); |
| 692 | iif!(cookie.exists(), Some(cookie), None) |
| 693 | } |
| 694 | |
| 695 | #[cfg(feature = "dirs")] |
| 696 | fn bitcoind_default_dir() -> Option<path::PathBuf> { |
no test coverage detected