Skip to content

Commit 8222341

Browse files
committed
wallet: MarkDirty after AddWalletDescriptor
After adding a wallet descriptor (typically by import), mark all balance caches dirty. This allows transactions that the wallet already knows about that have outputs that are now ISMINE_SPENDABLE after the import to actually be shown in balance calculations. Legacy wallet imports would do this, but importdescriptors did not.
1 parent e02f2d3 commit 8222341

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/wallet/wallet.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3735,6 +3735,9 @@ util::Result<std::reference_wrapper<DescriptorScriptPubKeyMan>> CWallet::AddWall
37353735
// Save the descriptor to DB
37363736
spk_man->WriteDescriptor();
37373737

3738+
// Break balance caches so that outputs that are now IsMine in already known txs will be included in the balance
3739+
MarkDirty();
3740+
37383741
return std::reference_wrapper(*spk_man);
37393742
}
37403743

0 commit comments

Comments
 (0)