diff options
-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: |