From c89fd12d48c5fa77e7f607ec9857544ffc640405 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Thu, 16 Feb 2023 15:56:10 +0700 Subject: [PATCH] fix: follow-up bitcoin#17260 for dash specific code Changes in this commit are required as a preparation to bitcoin#17261 Method GenerateNewHDChainEncrypted moved back from LegacyScriptManager to CWallet This methods should not be moved before in #17260. Also added 2 new methods in interface WalletStorage: NewKeyPoolCallback and KeepDestinationCallback --- src/wallet/rpcwallet.cpp | 2 +- src/wallet/scriptpubkeyman.cpp | 95 ++++------------------------------ src/wallet/scriptpubkeyman.h | 9 ++-- src/wallet/wallet.cpp | 93 ++++++++++++++++++++++++++++++++- src/wallet/wallet.h | 9 ++++ 5 files changed, 117 insertions(+), 91 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index e11cb1bc41..ca8b5e1161 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -2719,7 +2719,7 @@ static UniValue upgradetohd(const JSONRPCRequest& request) pwallet->SetMinVersion(FEATURE_HD); if (prev_encrypted) { - if (!spk_man->GenerateNewHDChainEncrypted(secureMnemonic, secureMnemonicPassphrase, secureWalletPassphrase)) { + if (!pwallet->GenerateNewHDChainEncrypted(secureMnemonic, secureMnemonicPassphrase, secureWalletPassphrase)) { throw JSONRPCError(RPC_WALLET_ERROR, "Failed to generate encrypted HD wallet"); } } else { diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp index 430c21fa76..bae908c3ac 100644 --- a/src/wallet/scriptpubkeyman.cpp +++ b/src/wallet/scriptpubkeyman.cpp @@ -4,9 +4,9 @@ #include #include -#include #include #include