diff options
author | Andrew Chow <achow101-github@achow101.com> | 2022-07-18 13:31:19 -0400 |
---|---|---|
committer | Andrew Chow <github@achow101.com> | 2023-06-13 15:11:41 -0400 |
commit | 43310200dce8d450ae5808824af788cefaa5d6db (patch) | |
tree | c168fe570e3f6ed30cd51a2333084b70d7cde92a | |
parent | e9379f1ffa7a4eebce397f1150317e840655e021 (diff) |
wallet: Ensure that the blank wallet flag is unset after imports
-rw-r--r-- | src/wallet/scriptpubkeyman.cpp | 2 | ||||
-rwxr-xr-x | test/functional/wallet_blank.py | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp index 62bd0c06cd..8c34c45e49 100644 --- a/src/wallet/scriptpubkeyman.cpp +++ b/src/wallet/scriptpubkeyman.cpp @@ -755,12 +755,12 @@ bool LegacyScriptPubKeyMan::AddKeyPubKeyWithDB(WalletBatch& batch, const CKey& s RemoveWatchOnly(script); } + m_storage.UnsetBlankWalletFlag(batch); if (!m_storage.HasEncryptionKeys()) { return batch.WriteKey(pubkey, secret.GetPrivKey(), mapKeyMetadata[pubkey.GetID()]); } - m_storage.UnsetBlankWalletFlag(batch); return true; } diff --git a/test/functional/wallet_blank.py b/test/functional/wallet_blank.py index 2767e5ffd7..eda3fda35b 100755 --- a/test/functional/wallet_blank.py +++ b/test/functional/wallet_blank.py @@ -72,8 +72,7 @@ class WalletBlankTest(BitcoinTestFramework): wif = bytes_to_wif(eckey.get_bytes(), eckey.is_compressed) wallet.importprivkey(wif) - # FIXME: A bug results in blank remaining set - assert_equal(wallet.getwalletinfo()["blank"], True) + assert_equal(wallet.getwalletinfo()["blank"], False) def test_importmulti(self): if self.options.descriptors: @@ -121,8 +120,7 @@ class WalletBlankTest(BitcoinTestFramework): def_wallet.dumpwallet(wallet_dump_path) wallet.importwallet(wallet_dump_path) - # FIXME: A bug results in blank remaining set - assert_equal(wallet.getwalletinfo()["blank"], True) + assert_equal(wallet.getwalletinfo()["blank"], False) def test_encrypt_legacy(self): if self.options.descriptors: |