Skip to content

Commit 7e2af06

Browse files
committed
wallet/migration: use HavePrivateKeys in place of ToPrivateString
ToPrivateString() behaviour will be modified in the following commits. This change ensures that wallet migration does not break.
1 parent 1441145 commit 7e2af06

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/wallet/scriptpubkeyman.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -717,10 +717,7 @@ std::optional<MigrationData> LegacyDataSPKM::MigrateToDescriptor()
717717

718718
std::vector<CScript> desc_spks;
719719

720-
// Make the descriptor string with private keys
721-
std::string desc_str;
722-
bool watchonly = !desc->ToPrivateString(*this, desc_str);
723-
if (watchonly && !m_storage.IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)) {
720+
if (!desc->HavePrivateKeys(*this) && !m_storage.IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)) {
724721
out.watch_descs.emplace_back(desc->ToString(), creation_time);
725722

726723
// Get the scriptPubKeys without writing this to the wallet

0 commit comments

Comments
 (0)