[backport#17889] wallet: Improve CWallet:MarkDestinationsDirty
Summary:
2b1641492fbf81e2c5a95f3e580811ca8700adc5 wallet: Improve CWallet:MarkDestinationsDirty (João Barbosa)
Pull request description:
Improve `CWallet:MarkDestinationsDirty` by skipping transactions that already have the cache invalidated. Skipping a transaction avoids at worst case extracting all output destinations.
Depends on D7685
Backport of Core PR17889
Test Plan:
ninja all check check-functional
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D7801