Skip to content

Commit c8a6f69

Browse files
knstkwvg
andcommitted
refactor: use args instead gArgs in new mnemonic code
Co-authored-by: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com>
1 parent d093506 commit c8a6f69

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/wallet/wallet.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2870,10 +2870,10 @@ std::shared_ptr<CWallet> CWallet::Create(WalletContext& context, const std::stri
28702870

28712871
LOCK(walletInstance->cs_wallet);
28722872
if (walletInstance->IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)) {
2873-
SecureString mnemonic = gArgs.GetArg("-mnemonic", "").c_str();
2874-
SecureString mnemonic_passphrase = gArgs.GetArg("-mnemonicpassphrase", "").c_str();
2875-
gArgs.ForceRemoveArg("mnemonic");
2876-
gArgs.ForceRemoveArg("mnemonicpassphrase");
2873+
SecureString mnemonic = args.GetArg("-mnemonic", "").c_str();
2874+
SecureString mnemonic_passphrase = args.GetArg("-mnemonicpassphrase", "").c_str();
2875+
args.ForceRemoveArg("mnemonic");
2876+
args.ForceRemoveArg("mnemonicpassphrase");
28772877
walletInstance->SetupDescriptorScriptPubKeyMans(mnemonic, mnemonic_passphrase);
28782878
// SetupDescriptorScriptPubKeyMans already calls SetupGeneration for us so we don't need to call SetupGeneration separately
28792879
} else { // Top up the keypool
@@ -3831,7 +3831,7 @@ void CWallet::SetupDescriptorScriptPubKeyMans(const SecureString& mnemonic_arg,
38313831

38323832
// Make a seed
38333833
// TODO: remove duplicated code with CHDChain::SetMnemonic
3834-
const SecureString mnemonic = mnemonic_arg.empty() ? CMnemonic::Generate(gArgs.GetIntArg("-mnemonicbits", CHDChain::DEFAULT_MNEMONIC_BITS)) : mnemonic_arg;
3834+
const SecureString mnemonic = mnemonic_arg.empty() ? CMnemonic::Generate(m_args.GetIntArg("-mnemonicbits", CHDChain::DEFAULT_MNEMONIC_BITS)) : mnemonic_arg;
38353835
if (!CMnemonic::Check(mnemonic)) {
38363836
throw std::runtime_error(std::string(__func__) + ": invalid mnemonic: `" + std::string(mnemonic.c_str()) + "`");
38373837
}

0 commit comments

Comments
 (0)