From: rustaceanrob Date: Tue, 17 Jun 2025 12:36:59 +0000 (+0100) Subject: fix(kyoto): remove conn requirement to send tx X-Git-Tag: v2.0.0~7^2 X-Git-Url: http://internal-gitweb-vhost/struct.SegwitCodeLengthError.html?a=commitdiff_plain;h=3b60b7b2321c7a9827f693e50431c87dd3992cae;p=bdk-cli fix(kyoto): remove conn requirement to send tx Kyoto now holds on to a transaction internally until it is successfully broadcast, so we can broadcast the transaction immediately once the node starts up, and wait for a confirmation or 30 second timeout --- diff --git a/src/handlers.rs b/src/handlers.rs index e3f2605..370681a 100644 --- a/src/handlers.rs +++ b/src/handlers.rs @@ -576,19 +576,10 @@ pub(crate) async fn handle_online_wallet_subcommand( } }); let txid = tx.compute_txid(); - tracing::info!("Waiting for connections to broadcast..."); - while let Some(info) = info_subscriber.recv().await { - match info { - Info::ConnectionsMet => { - requester - .broadcast_random(tx.clone()) - .map_err(|e| Error::Generic(format!("{}", e)))?; - break; - } - _ => tracing::info!("{info}"), - } - } - tokio::time::timeout(tokio::time::Duration::from_secs(15), async move { + requester + .broadcast_random(tx.clone()) + .map_err(|e| Error::Generic(format!("{}", e)))?; + tokio::time::timeout(tokio::time::Duration::from_secs(30), async move { while let Some(info) = info_subscriber.recv().await { match info { Info::TxGossiped(wtxid) => { @@ -606,7 +597,7 @@ pub(crate) async fn handle_online_wallet_subcommand( .await .map_err(|_| { tracing::warn!("Broadcast was unsuccessful"); - Error::Generic("Transaction broadcast timed out after 15 seconds".into()) + Error::Generic("Transaction broadcast timed out after 30 seconds".into()) })?; txid }