mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-03 09:43:55 +02:00
Merge bitcoin/bitcoin#31250: wallet: Disable creating and loading legacy wallets
17bb63f9f9wallet: Disallow loading legacy wallets (Ava Chow)9f04e02ffawallet: Disallow creating legacy wallets (Ava Chow)6b247279b7wallet: Disallow legacy wallet creation from the wallet tool (Ava Chow)5e93b1fd6cbench: Remove WalletLoadingLegacy benchmark (Ava Chow)56f959d829wallet: Remove wallettool salvage (Ava Chow)7a41c939f0wallet: Remove -format and bdb from wallet tool's createfromdump (Ava Chow)c847dee148test: remove legacy wallet functional tests (Ava Chow)20a9173717test: Remove legacy wallet tests from wallet_reindex.py (Ava Chow)446d480cb2test: Remove legacy wallet tests from wallet_backwards_compatibility.py (Ava Chow)aff80298d0test: wallet_signer.py bdb will be removed (Ava Chow)f94f9399actest: Remove legacy wallet unit tests (Ava Chow)d9ac9dbd8etests, gui: Use descriptors watchonly wallet for watchonly test (Ava Chow) Pull request description: To prepare for the deletion of legacy wallet code, disable creating or loading new legacy wallets. Tests for the legacy wallet specifically are deleted. Split from https://github.com/bitcoin/bitcoin/pull/28710 ACKs for top commit: Sjors: re-ACK17bb63f9f9pablomartin4btc: re-ACK17bb63f9f9laanwj: re-ACK17bb63f9f9Tree-SHA512: d7a86df1f71f12451b335f22f7c3f0394166ac3f8f5b81f6bbf0321026e2e8ed621576656c371d70e202df1be4410b2b1c1acb5d5f0c341e7b67aaa0ac792e7c
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
|
||||
#include <addresstype.h>
|
||||
#include <bench/bench.h>
|
||||
#include <bitcoin-build-config.h> // IWYU pragma: keep
|
||||
#include <key.h>
|
||||
#include <key_io.h>
|
||||
#include <script/descriptor.h>
|
||||
@@ -26,7 +25,7 @@
|
||||
#include <utility>
|
||||
|
||||
namespace wallet {
|
||||
static void WalletIsMine(benchmark::Bench& bench, bool legacy_wallet, int num_combo = 0)
|
||||
static void WalletIsMine(benchmark::Bench& bench, int num_combo = 0)
|
||||
{
|
||||
const auto test_setup = MakeNoLogFileContext<TestingSetup>();
|
||||
|
||||
@@ -36,16 +35,13 @@ static void WalletIsMine(benchmark::Bench& bench, bool legacy_wallet, int num_co
|
||||
|
||||
// Setup the wallet
|
||||
// Loading the wallet will also create it
|
||||
uint64_t create_flags = 0;
|
||||
if (!legacy_wallet) {
|
||||
create_flags = WALLET_FLAG_DESCRIPTORS;
|
||||
}
|
||||
uint64_t create_flags = WALLET_FLAG_DESCRIPTORS;
|
||||
auto database = CreateMockableWalletDatabase();
|
||||
auto wallet = TestLoadWallet(std::move(database), context, create_flags);
|
||||
|
||||
// For a descriptor wallet, fill with num_combo combo descriptors with random keys
|
||||
// This benchmarks a non-HD wallet migrated to descriptors
|
||||
if (!legacy_wallet && num_combo > 0) {
|
||||
if (num_combo > 0) {
|
||||
LOCK(wallet->cs_wallet);
|
||||
for (int i = 0; i < num_combo; ++i) {
|
||||
CKey key;
|
||||
@@ -70,13 +66,8 @@ static void WalletIsMine(benchmark::Bench& bench, bool legacy_wallet, int num_co
|
||||
TestUnloadWallet(std::move(wallet));
|
||||
}
|
||||
|
||||
#ifdef USE_BDB
|
||||
static void WalletIsMineLegacy(benchmark::Bench& bench) { WalletIsMine(bench, /*legacy_wallet=*/true); }
|
||||
BENCHMARK(WalletIsMineLegacy, benchmark::PriorityLevel::LOW);
|
||||
#endif
|
||||
|
||||
static void WalletIsMineDescriptors(benchmark::Bench& bench) { WalletIsMine(bench, /*legacy_wallet=*/false); }
|
||||
static void WalletIsMineMigratedDescriptors(benchmark::Bench& bench) { WalletIsMine(bench, /*legacy_wallet=*/false, /*num_combo=*/2000); }
|
||||
static void WalletIsMineDescriptors(benchmark::Bench& bench) { WalletIsMine(bench); }
|
||||
static void WalletIsMineMigratedDescriptors(benchmark::Bench& bench) { WalletIsMine(bench, /*num_combo=*/2000); }
|
||||
BENCHMARK(WalletIsMineDescriptors, benchmark::PriorityLevel::LOW);
|
||||
BENCHMARK(WalletIsMineMigratedDescriptors, benchmark::PriorityLevel::LOW);
|
||||
} // namespace wallet
|
||||
|
||||
Reference in New Issue
Block a user