mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-31 19:06:10 +02:00
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.
This commit is contained in:
@@ -3735,6 +3735,9 @@ util::Result<std::reference_wrapper<DescriptorScriptPubKeyMan>> CWallet::AddWall
|
||||
// Save the descriptor to DB
|
||||
spk_man->WriteDescriptor();
|
||||
|
||||
// Break balance caches so that outputs that are now IsMine in already known txs will be included in the balance
|
||||
MarkDirty();
|
||||
|
||||
return std::reference_wrapper(*spk_man);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user