Skip to content

Commit 2d5be7a

Browse files
author
Fernando Ledesma
committed
Fix async/await for handle_expired_htlcs method
The handle_expired_htlcs method was calling an async function without awaiting it, causing a compiler warning. Made the method async and added proper await calls.
1 parent 1618a45 commit 2d5be7a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ impl Node {
635635
return;
636636
}
637637
_ = tokio::time::sleep(Duration::from_secs(HTLC_EXPIRY_CHECK_INTERVAL_SECS)) => {
638-
liquidity_handler.handle_expired_htlcs();
638+
liquidity_handler.handle_expired_htlcs().await;
639639
}
640640
_ = liquidity_handler.handle_next_event() => {}
641641
}

src/liquidity.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,10 +480,10 @@ where
480480
self.lsps4_client.as_ref().map(|s| (s.lsp_node_id, s.lsp_address.clone()))
481481
}
482482

483-
pub(crate) fn handle_expired_htlcs(&self) {
483+
pub(crate) async fn handle_expired_htlcs(&self) {
484484
if let Some(lsps4_service_handler) = self.liquidity_manager.lsps4_service_handler() {
485485
let now = SystemTime::now().duration_since(UNIX_EPOCH).unwrap_or_default().as_secs();
486-
lsps4_service_handler.handle_expired_htlcs(now);
486+
lsps4_service_handler.handle_expired_htlcs(now).await;
487487
}
488488
}
489489

0 commit comments

Comments
 (0)