mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-29 03:38:10 -07:00
global: snapshot
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
use std::env;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::thread::sleep;
|
||||
use std::{mem, sync::Arc, time::Duration};
|
||||
|
||||
@@ -270,4 +272,27 @@ impl Client {
|
||||
{
|
||||
self.0.call_once(f)
|
||||
}
|
||||
|
||||
pub fn default_url() -> &'static str {
|
||||
"http://localhost:8332"
|
||||
}
|
||||
|
||||
pub fn default_bitcoin_path() -> PathBuf {
|
||||
if env::consts::OS == "macos" {
|
||||
Self::default_mac_bitcoin_path()
|
||||
} else {
|
||||
Self::default_linux_bitcoin_path()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn default_linux_bitcoin_path() -> PathBuf {
|
||||
Path::new(&env::var("HOME").unwrap()).join(".bitcoin")
|
||||
}
|
||||
|
||||
pub fn default_mac_bitcoin_path() -> PathBuf {
|
||||
Path::new(&env::var("HOME").unwrap())
|
||||
.join("Library")
|
||||
.join("Application Support")
|
||||
.join("Bitcoin")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user