Skip to content

Commit 93e10ca

Browse files
committed
Merge bitcoin/bitcoin#29367: wallet: Set descriptors flag after migrating blank wallets
3904123 tests: Test that descriptors flag is set for migrated blank wallets (Ava Chow) 072d506 wallet: Make sure that the descriptors flag is set for blank wallets (Ava Chow) Pull request description: While rebasing #28710 after #28976 was merged, I realized that although blank wallets were being moved to sqlite, `WALLET_FLAG_DESCRIPTORS` was not being set so those blank wallets would still continue to be treated as legacy wallets. To fix that, just set the descriptor flags for blank wallets. Also added a test to catch this. ACKs for top commit: epiccurious: Tested ACK 3904123. delta1: tested ACK 3904123 ryanofsky: Code review ACK 3904123 murchandamus: code review ACK 3904123 Tree-SHA512: 9f6fe9c1899ca387ab909b1bb6956cd6bc5acbf941686ddc6c061f9b1ceec2cc9d009ff472486fc86e963f6068f0e2f1ae96282e7c630193797a9734c4f424ab
2 parents 3894104 + 3904123 commit 93e10ca

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/wallet/wallet.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4257,6 +4257,9 @@ util::Result<MigrationResult> MigrateLegacyToDescriptor(const std::string& walle
42574257
success = local_wallet->IsWalletFlagSet(WALLET_FLAG_BLANK_WALLET);
42584258
if (!success) {
42594259
success = DoMigration(*local_wallet, context, error, res);
4260+
} else {
4261+
// Make sure that descriptors flag is actually set
4262+
local_wallet->SetWalletFlag(WALLET_FLAG_DESCRIPTORS);
42604263
}
42614264
}
42624265

test/functional/wallet_migration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ def test_blank(self):
881881
assert_equal(wallet.getwalletinfo()["blank"], True)
882882
wallet.migratewallet()
883883
assert_equal(wallet.getwalletinfo()["blank"], True)
884-
884+
assert_equal(wallet.getwalletinfo()["descriptors"], True)
885885

886886
def test_avoidreuse(self):
887887
self.log.info("Test that avoidreuse persists after migration")

0 commit comments

Comments
 (0)