mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-09-13 18:13:42 +02:00
Merge bitcoin/bitcoin#29367: wallet: Set descriptors flag after migrating blank wallets
3904123da9
tests: Test that descriptors flag is set for migrated blank wallets (Ava Chow)072d506240
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 ACK3904123da9
. delta1: tested ACK3904123da9
ryanofsky: Code review ACK3904123da9
murchandamus: code review ACK3904123da9
Tree-SHA512: 9f6fe9c1899ca387ab909b1bb6956cd6bc5acbf941686ddc6c061f9b1ceec2cc9d009ff472486fc86e963f6068f0e2f1ae96282e7c630193797a9734c4f424ab
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -881,7 +881,7 @@ class WalletMigrationTest(BitcoinTestFramework):
|
||||
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")
|
||||
|
Reference in New Issue
Block a user