From 7db8565dda92cbe1cbd0e61a5d88c0655ae1ed3c Mon Sep 17 00:00:00 2001 From: Murisi Tarusenga Date: Fri, 30 Aug 2024 09:46:50 +0200 Subject: [PATCH] Enable the signing logic to fall back to the hardware wallet if secret key is not found. --- crates/sdk/src/signing.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/sdk/src/signing.rs b/crates/sdk/src/signing.rs index 01b9f819e3..746cda2bf3 100644 --- a/crates/sdk/src/signing.rs +++ b/crates/sdk/src/signing.rs @@ -231,7 +231,13 @@ where for public_key in &signing_data.public_keys { if !used_pubkeys.contains(public_key) { - let secret_key = find_key_by_pk(&mut wallet, args, public_key)?; + let Ok(secret_key) = + find_key_by_pk(&mut wallet, args, public_key) + else { + // If the secret key is not found, continue because the + // hardware wallet may still be able to sign this + continue; + }; used_pubkeys.insert(public_key.clone()); signing_tx_keypairs.push(secret_key); }