diff --git a/src/wallet/monero_wallet_core.cpp b/src/wallet/monero_wallet_core.cpp index a656447..ff0767a 100644 --- a/src/wallet/monero_wallet_core.cpp +++ b/src/wallet/monero_wallet_core.cpp @@ -821,7 +821,7 @@ namespace monero { return wallet; } - monero_wallet_core* monero_wallet_core::create_wallet_from_mnemonic(const string& path, const string& password, const monero_network_type network_type, const string& mnemonic, const monero_rpc_connection& daemon_connection, uint64_t restore_height, const string& offset) { + monero_wallet_core* monero_wallet_core::create_wallet_from_mnemonic(const string& path, const string& password, const monero_network_type network_type, const string& mnemonic, const monero_rpc_connection& daemon_connection, uint64_t restore_height, const string& seed_offset) { MTRACE("create_wallet_from_mnemonic(path, password, mnemonic, network_type, daemon_connection, restore_height)"); monero_wallet_core* wallet = new monero_wallet_core(); @@ -833,7 +833,7 @@ namespace monero { if (language == crypto::ElectrumWords::old_language_name) language = Language::English().get_language_name(); // apply offset if given - if (!offset.empty()) recovery_key = cryptonote::decrypt_key(recovery_key, offset); + if (!seed_offset.empty()) recovery_key = cryptonote::decrypt_key(recovery_key, seed_offset); // initialize wallet wallet->m_w2 = unique_ptr(new tools::wallet2(static_cast(network_type), 1, true)); diff --git a/src/wallet/monero_wallet_core.h b/src/wallet/monero_wallet_core.h index 77682d7..a793e4c 100644 --- a/src/wallet/monero_wallet_core.h +++ b/src/wallet/monero_wallet_core.h @@ -119,8 +119,9 @@ namespace monero { * @param mnemonic is the mnemonic of the wallet to construct * @param daemon_connection is connection information to a daemon (default = an unconnected wallet) * @param restore_height is the block height to restore (i.e. scan the chain) from (default = 0) + * @param seed_offset is a string used to derive a new mnemonic from the given mnemonic, allowing password-protected wallets to be recovered from a plain-text mnemonic */ - static monero_wallet_core* create_wallet_from_mnemonic(const string& path, const string& password, const monero_network_type network_type, const string& mnemonic, const monero_rpc_connection& daemon_connection, uint64_t restore_height, const string& offset); + static monero_wallet_core* create_wallet_from_mnemonic(const string& path, const string& password, const monero_network_type network_type, const string& mnemonic, const monero_rpc_connection& daemon_connection, uint64_t restore_height, const string& seed_offset); /** * Create a wallet from an address, view key, and spend key. diff --git a/src/wallet/monero_wallet_keys.cpp b/src/wallet/monero_wallet_keys.cpp index 75dd5f4..e31c2e9 100644 --- a/src/wallet/monero_wallet_keys.cpp +++ b/src/wallet/monero_wallet_keys.cpp @@ -93,7 +93,7 @@ namespace monero { return wallet; } - monero_wallet_keys* monero_wallet_keys::create_wallet_from_mnemonic(const monero_network_type network_type, const string& mnemonic, const string& offset) { + monero_wallet_keys* monero_wallet_keys::create_wallet_from_mnemonic(const monero_network_type network_type, const string& mnemonic, const string& seed_offset) { // validate mnemonic and get recovery key and language crypto::secret_key recovery_key; @@ -103,7 +103,7 @@ namespace monero { if (language == crypto::ElectrumWords::old_language_name) language = Language::English().get_language_name(); // apply offset if given - if (!offset.empty()) recovery_key = cryptonote::decrypt_key(recovery_key, offset); + if (!seed_offset.empty()) recovery_key = cryptonote::decrypt_key(recovery_key, seed_offset); // initialize wallet account monero_wallet_keys* wallet = new monero_wallet_keys(); diff --git a/src/wallet/monero_wallet_keys.h b/src/wallet/monero_wallet_keys.h index c9ab185..2b57c82 100644 --- a/src/wallet/monero_wallet_keys.h +++ b/src/wallet/monero_wallet_keys.h @@ -86,7 +86,7 @@ namespace monero { * @param network_type is the wallet's network type * @param mnemonic is the mnemonic of the wallet to construct */ - static monero_wallet_keys* create_wallet_from_mnemonic(const monero_network_type network_type, const string& mnemonic, const string& offset); + static monero_wallet_keys* create_wallet_from_mnemonic(const monero_network_type network_type, const string& mnemonic, const string& seed_offset); /** * Create a wallet from an address, view key, and spend key.