From 64a00120808cec2f8d074c012e10a2ab780171ff Mon Sep 17 00:00:00 2001 From: Omer Yacine Date: Wed, 22 Jan 2025 11:46:11 +0100 Subject: [PATCH] clear up the doc comment confusion --- mm2src/mm2_main/src/lp_native_dex.rs | 1 + mm2src/mm2_main/src/lp_swap.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mm2src/mm2_main/src/lp_native_dex.rs b/mm2src/mm2_main/src/lp_native_dex.rs index 3af6d231f1..594daeb7d2 100644 --- a/mm2src/mm2_main/src/lp_native_dex.rs +++ b/mm2src/mm2_main/src/lp_native_dex.rs @@ -536,6 +536,7 @@ pub async fn lp_init(ctx: MmArc, version: String, datetime: String) -> MmInitRes }; Timer::sleep(0.2).await } + // Clearing up the running swaps removes any circular references that might prevent the context from being dropped. lp_swap::clear_running_swaps(&ctx); Ok(()) diff --git a/mm2src/mm2_main/src/lp_swap.rs b/mm2src/mm2_main/src/lp_swap.rs index 16ebcee5ae..f9baf2ca4d 100644 --- a/mm2src/mm2_main/src/lp_swap.rs +++ b/mm2src/mm2_main/src/lp_swap.rs @@ -656,7 +656,7 @@ pub fn get_locked_amount(ctx: &MmArc, coin: &str) -> MmNumber { /// Clear up all the running swaps. /// -/// This also auto-stops any running swaps since their abort handles will get triggered (assuming these abort handles aren't already triggered by other means). +/// This doesn't mean that these swaps will be stopped. They can only be stopped from the abortable systems they are running on top of. pub fn clear_running_swaps(ctx: &MmArc) { let swap_ctx = SwapsContext::from_ctx(ctx).unwrap(); swap_ctx.running_swaps.lock().unwrap().clear();