feat: only trigger UTXO scanning when a new block event is received #3620
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Previously the UTXO scanner task was triggered on an interval. This PR updates this process to rather be triggered only when an existing task is not running and new Block event is received from the wallet Base Node monitoring service. It is only when this event is received when we know there will be new block data to scan.
A new event is added to the Base Node Monitoring Service that only fires when a new block is detected to be used in the above functionality
The Utxo Scanner is also refactored into separate files. To help in the review I have highlighted the new code below
An unrelated bug is also fixed with handling of the wallet public address in the Console Wallet that broke the wallet.
How Has This Been Tested?
manually and by CI