Skip to content

Commit 4331020

Browse files
committed
wallet: Ensure that the blank wallet flag is unset after imports
1 parent e9379f1 commit 4331020

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/wallet/scriptpubkeyman.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,12 +755,12 @@ bool LegacyScriptPubKeyMan::AddKeyPubKeyWithDB(WalletBatch& batch, const CKey& s
755755
RemoveWatchOnly(script);
756756
}
757757

758+
m_storage.UnsetBlankWalletFlag(batch);
758759
if (!m_storage.HasEncryptionKeys()) {
759760
return batch.WriteKey(pubkey,
760761
secret.GetPrivKey(),
761762
mapKeyMetadata[pubkey.GetID()]);
762763
}
763-
m_storage.UnsetBlankWalletFlag(batch);
764764
return true;
765765
}
766766

test/functional/wallet_blank.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ def test_importprivkey(self):
7272
wif = bytes_to_wif(eckey.get_bytes(), eckey.is_compressed)
7373

7474
wallet.importprivkey(wif)
75-
# FIXME: A bug results in blank remaining set
76-
assert_equal(wallet.getwalletinfo()["blank"], True)
75+
assert_equal(wallet.getwalletinfo()["blank"], False)
7776

7877
def test_importmulti(self):
7978
if self.options.descriptors:
@@ -121,8 +120,7 @@ def test_importwallet(self):
121120
def_wallet.dumpwallet(wallet_dump_path)
122121

123122
wallet.importwallet(wallet_dump_path)
124-
# FIXME: A bug results in blank remaining set
125-
assert_equal(wallet.getwalletinfo()["blank"], True)
123+
assert_equal(wallet.getwalletinfo()["blank"], False)
126124

127125
def test_encrypt_legacy(self):
128126
if self.options.descriptors:

0 commit comments

Comments
 (0)