From cfa7635ae1bdb35ab872e10708127be493e291c8 Mon Sep 17 00:00:00 2001 From: Andrej Mihajlov Date: Mon, 13 Oct 2025 12:25:54 +0200 Subject: [PATCH] Propagate cancel token to mixnet client --- Cargo.lock | 1 - nym-registration-client/src/builder/config.rs | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 20a519f085..01206ee22f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5746,7 +5746,6 @@ dependencies = [ "criterion", "ff", "group", - "lazy_static", "nym-contracts-common", "nym-pemstore", "rand 0.8.5", diff --git a/nym-registration-client/src/builder/config.rs b/nym-registration-client/src/builder/config.rs index 494e3fb2a1..d05abb2ae3 100644 --- a/nym-registration-client/src/builder/config.rs +++ b/nym-registration-client/src/builder/config.rs @@ -4,7 +4,8 @@ use nym_credential_storage::persistent_storage::PersistentStorage; use nym_registration_common::NymNode; use nym_sdk::{ - DebugConfig, NymNetworkDetails, RememberMe, TopologyProvider, UserAgent, + DebugConfig, NymNetworkDetails, RememberMe, ShutdownToken, ShutdownTracker, TopologyProvider, + UserAgent, mixnet::{ CredentialStorage, GatewaysDetailsStore, KeyStore, MixnetClient, MixnetClientBuilder, MixnetClientStorage, OnDiskPersistent, ReplyStorageBackend, StoragePaths, x25519::KeyPair, @@ -115,7 +116,10 @@ impl BuilderConfig { .debug_config(debug_config) .credentials_mode(true) .with_remember_me(remember_me) - .custom_topology_provider(self.custom_topology_provider); + .custom_topology_provider(self.custom_topology_provider) + .custom_shutdown(ShutdownTracker::new_from_external_shutdown_token( + ShutdownToken::from(self.cancel_token), + )); #[cfg(unix)] let builder = builder.with_connection_fd_callback(self.connection_fd_callback);