Skip to content

Commit 510f6be

Browse files
authored
feat: block seed words extraction from view only wallets (#7022)
Description --- Block the extraction of seed words from wallets that don't have access to the correct seed words, which is view only wallets and hardware enabled wallets. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Exporting seed words is now restricted to supported wallet types only. Users with Hardware or View-only wallets will no longer be able to export seed words, and will receive an appropriate error message if they attempt to do so. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent b1d7a6d commit 510f6be

File tree

1 file changed

+6
-0
lines changed
  • applications/minotari_console_wallet/src/init

1 file changed

+6
-0
lines changed

applications/minotari_console_wallet/src/init/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,12 @@ pub async fn init_wallet(
485485
);
486486

487487
if let Some(file_name) = seed_words_file_name {
488+
if wallet.db.get_wallet_type()? != Some(WalletType::DerivedKeys) {
489+
return Err(ExitError::new(
490+
ExitCode::WalletError,
491+
"Cannot export seed words from a Hardware/View_only wallet",
492+
));
493+
}
488494
let seed_words = wallet.get_seed_words(&MnemonicLanguage::English)?.join(" ");
489495
let _result = fs::write(file_name, seed_words.reveal()).map_err(|e| {
490496
ExitError::new(

0 commit comments

Comments
 (0)