Skip to content

Commit b2aba5e

Browse files
authored
Fix cli conf: cookie and db (payjoin#609)
2 parents 7bcded5 + 4cde25c commit b2aba5e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

payjoin-cli/example.config.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# --------------
77

88
# The path to the database file
9-
db_path = "payjoin.db"
9+
db_path = "payjoin.sled"
1010

1111
# The maximum fee rate that the receiver is willing to pay (in sat/vB)
1212
max_fee_rate = 2.0
@@ -29,7 +29,7 @@ rpchost = "http://localhost:18443/wallet/sender"
2929
# MacOS: ~/Library/Application Support/Bitcoin/<NETWORK>/.cookie
3030
# Windows Vista and later: C:\Users\YourUserName\AppData\Roaming\Bitcoin\<NETWORK>\.cookie
3131
# Windows XP: C:\Documents and Settings\YourUserName\Application Data\Bitcoin\<NETWORK>\.cookie
32-
cookie = ""
32+
# cookie = ""
3333

3434
# The rpcuser to connect to (specified in bitcoin.conf).
3535
rpcuser = "user"

payjoin-cli/src/app/wallet.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ pub struct BitcoindWallet {
2323
impl BitcoindWallet {
2424
pub fn new(config: &crate::app::config::BitcoindConfig) -> Result<Self> {
2525
let client = match &config.cookie {
26+
Some(cookie) if cookie.as_os_str().is_empty() =>
27+
return Err(anyhow!(
28+
"Cookie authentication enabled but no cookie path provided in config.toml"
29+
)),
2630
Some(cookie) => Client::new(config.rpchost.as_str(), Auth::CookieFile(cookie.into())),
2731
None => Client::new(
2832
config.rpchost.as_str(),

0 commit comments

Comments
 (0)