Skip to content

Commit 7a71b14

Browse files
committed
Merge #202: Kyoto: Remove connection requirement to send tx
3b60b7b fix(kyoto): remove conn requirement to send tx (rustaceanrob) Pull request description: 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 Successful test on Signet. Note that `Testnet4` still has the difficulty adjustment bug when loading block headers from storage. ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk-cli/blob/master/CONTRIBUTING.md) * [x] I ran `cargo fmt` and `cargo clippy` before committing #### New Features: * [ ] I've added tests for the new feature * [ ] I've added docs for the new feature * [ ] I've updated `CHANGELOG.md` #### Bugfixes: * [ ] This pull request breaks the existing API * [ ] I've added tests to reproduce the issue which are now passing * [ ] I'm linking the issue being fixed by this PR Top commit has no ACKs. Tree-SHA512: e1ad420440bad12b42847f09cc564e9fcc292c5acf12ac173560652c85a3fcf802052d20206bef7a8615d6beb93519c83c519dc086d8604656f088e78ef424b4
2 parents 85da2af + 3b60b7b commit 7a71b14

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)