diff --git a/bindings/nodejs/src/wallet.rs b/bindings/nodejs/src/wallet.rs index 25094a5fd9..ae90b2131d 100644 --- a/bindings/nodejs/src/wallet.rs +++ b/bindings/nodejs/src/wallet.rs @@ -59,7 +59,11 @@ pub async fn create_wallet(options: String) -> Result) { - **wallet.as_ref().write().await = None; + let mut wallet = wallet.as_ref().write().await; + if let Some(wallet) = &**wallet { + wallet.request_stop_background_syncing(); + } + **wallet = None; } #[napi(js_name = "callWalletMethod")]