Skip to content

Commit

Permalink
Merge pull request #1199 from get10101/fix/add-buffer-delay-after-out…
Browse files Browse the repository at this point in the history
…bound-capacity

fix: Add buffer delay after outbound capacity is ready
  • Loading branch information
holzeis authored Aug 30, 2023
2 parents 8bdcc1c + 284ef12 commit b252073
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions mobile/native/src/channel_fee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,15 @@ impl ChannelFeePaymentSubscriber {
funding_tx_fees_msats,
"Waiting for outbound capacity on channel to pay jit channel opening fee.",
);
Handle::current()
.block_on(self.wait_for_outbound_capacity(channel_id, funding_tx_fees_msats))
Handle::current().block_on(async {
self.wait_for_outbound_capacity(channel_id, funding_tx_fees_msats)
.await?;
// We add another sleep to ensure that the channel has actually been updated after
// receiving the payment. Note, this is by no means ideal and should
// be revisited some other time.
tokio::time::sleep(Duration::from_millis(500)).await;
anyhow::Ok(())
})
})
.context("Failed during wait for outbound capacity")?;

Expand Down

0 comments on commit b252073

Please sign in to comment.