We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f7a5cd6 commit 69c4ed5Copy full SHA for 69c4ed5
src/lib.rs
@@ -218,7 +218,11 @@ impl BitcoinD {
218
219
/// Launch the bitcoind process from the given `exe` executable with given [Conf] param
220
pub fn with_conf<S: AsRef<OsStr>>(exe: S, conf: &Conf) -> Result<BitcoinD, Error> {
221
- let work_dir = match (&conf.tmpdir, &conf.staticdir) {
+ let tmpdir = conf
222
+ .tmpdir
223
+ .clone()
224
+ .or_else(|| env::var("TEMPDIR_ROOT").map(PathBuf::from).ok());
225
+ let work_dir = match (&tmpdir, &conf.staticdir) {
226
(Some(_), Some(_)) => return Err(Error::BothDirsSpecified),
227
(Some(tmpdir), None) => DataDir::Temporary(TempDir::new_in(tmpdir)?),
228
(None, Some(workdir)) => {
0 commit comments