Skip to content

Commit 3b60b7b

Browse files
committed
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
1 parent 85da2af commit 3b60b7b

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

src/handlers.rs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -576,19 +576,10 @@ pub(crate) async fn handle_online_wallet_subcommand(
576576
}
577577
});
578578
let txid = tx.compute_txid();
579-
tracing::info!("Waiting for connections to broadcast...");
580-
while let Some(info) = info_subscriber.recv().await {
581-
match info {
582-
Info::ConnectionsMet => {
583-
requester
584-
.broadcast_random(tx.clone())
585-
.map_err(|e| Error::Generic(format!("{}", e)))?;
586-
break;
587-
}
588-
_ => tracing::info!("{info}"),
589-
}
590-
}
591-
tokio::time::timeout(tokio::time::Duration::from_secs(15), async move {
579+
requester
580+
.broadcast_random(tx.clone())
581+
.map_err(|e| Error::Generic(format!("{}", e)))?;
582+
tokio::time::timeout(tokio::time::Duration::from_secs(30), async move {
592583
while let Some(info) = info_subscriber.recv().await {
593584
match info {
594585
Info::TxGossiped(wtxid) => {
@@ -606,7 +597,7 @@ pub(crate) async fn handle_online_wallet_subcommand(
606597
.await
607598
.map_err(|_| {
608599
tracing::warn!("Broadcast was unsuccessful");
609-
Error::Generic("Transaction broadcast timed out after 15 seconds".into())
600+
Error::Generic("Transaction broadcast timed out after 30 seconds".into())
610601
})?;
611602
txid
612603
}

0 commit comments

Comments
 (0)