Skip to content

Commit 5a32f57

Browse files
committed
fixup: add some better debug logs
1 parent a7c7911 commit 5a32f57

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/chain/electrum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ impl ElectrumRuntimeClient {
432432
if config.anchor_channels_config.is_some() {
433433
electrum_client.transaction_broadcast_package(&[dummy_transaction()]).map_err(|e| {
434434
log_error!(logger, "Electrum server does not support submit package: {:?}", e);
435-
Error::ConnectionFailed
435+
Error::ChainSourceNotSupported
436436
})?;
437437
}
438438
let bdk_electrum_client = Arc::new(BdkElectrumClient::new(Arc::clone(&electrum_client)));

src/error.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ pub enum Error {
137137
LnurlAuthTimeout,
138138
/// The provided lnurl is invalid.
139139
InvalidLnurl,
140+
/// Chain source not supported
141+
ChainSourceNotSupported,
140142
}
141143

142144
impl fmt::Display for Error {
@@ -222,6 +224,7 @@ impl fmt::Display for Error {
222224
Self::LnurlAuthFailed => write!(f, "LNURL-auth authentication failed."),
223225
Self::LnurlAuthTimeout => write!(f, "LNURL-auth authentication timed out."),
224226
Self::InvalidLnurl => write!(f, "The provided lnurl is invalid."),
227+
Self::ChainSourceNotSupported => write!(f, "The selected chain source does not support `submitpackage`"),
225228
}
226229
}
227230
}

tests/common/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,8 @@ pub(crate) fn setup_bitcoind_and_electrsd() -> (BitcoinD, ElectrsD) {
325325
pub(crate) fn random_chain_source<'a>(
326326
bitcoind: &'a BitcoinD, electrsd: &'a ElectrsD,
327327
) -> TestChainSource<'a> {
328+
TestChainSource::Electrum(electrsd)
329+
/*
328330
let r = rand::random_range(0..3);
329331
match r {
330332
0 => {
@@ -345,6 +347,7 @@ pub(crate) fn random_chain_source<'a>(
345347
},
346348
_ => unreachable!(),
347349
}
350+
*/
348351
}
349352

350353
pub(crate) fn random_storage_path() -> PathBuf {

0 commit comments

Comments
 (0)