Skip to content

Commit

Permalink
Merge bitcoin#29367: wallet: Set descriptors flag after migrating bla…
Browse files Browse the repository at this point in the history
…nk 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 bitcoin#28710 after bitcoin#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
  • Loading branch information
ryanofsky committed Feb 2, 2024
2 parents 3894104 + 3904123 commit 93e10ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4257,6 +4257,9 @@ util::Result<MigrationResult> MigrateLegacyToDescriptor(const std::string& walle
success = local_wallet->IsWalletFlagSet(WALLET_FLAG_BLANK_WALLET);
if (!success) {
success = DoMigration(*local_wallet, context, error, res);
} else {
// Make sure that descriptors flag is actually set
local_wallet->SetWalletFlag(WALLET_FLAG_DESCRIPTORS);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/functional/wallet_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ def test_blank(self):
assert_equal(wallet.getwalletinfo()["blank"], True)
wallet.migratewallet()
assert_equal(wallet.getwalletinfo()["blank"], True)

assert_equal(wallet.getwalletinfo()["descriptors"], True)

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

0 comments on commit 93e10ca

Please sign in to comment.