Skip to content

Commit 771f45b

Browse files
committed
fixup: add some better debug logs
1 parent a7c7911 commit 771f45b

4 files changed

Lines changed: 10 additions & 1 deletion

File tree

bindings/ldk_node.udl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ enum NodeError {
229229
"LnurlAuthFailed",
230230
"LnurlAuthTimeout",
231231
"InvalidLnurl",
232+
"ChainSourceNotSupported",
232233
};
233234

234235
typedef dictionary NodeStatus;

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: 5 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,9 @@ 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 => {
228+
write!(f, "The selected chain source does not support `submitpackage`")
229+
},
225230
}
226231
}
227232
}

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)