[Cashtab] [WS Update Engine Part 3] On websocket tx seen message, refresh the wallet utxo set
Summary:
T2447
Depends on D11657
Part 3 (of 4 planned) stacked diff for converting Cashtab from a static refresh rate to an on-demand refresh rate depending on Websocket transaction messages
When the websocket sees a new transaction, clear the existing 30s interval and reset it to near instant. Then set it back after refreshing the walle utxo set.
In this way, the wallet is instantly updated when a new tx is seen --- instead of the current approach, which checks the API constantly to verify if any changes have occurred.
The figure 10 is arbitrarily chosen for the 'instant' interval reset because choosing zero causes the wallet to refresh multiple times before the function is reset.
This diff includes debug logs that are useful in the testing of this diff that will be removed in the final part of this stacked diff.
Test Plan:
npm start
Receive a tx with the wallet
Note incoming tx notification and immediate balance update
Note that tick() does not appear multiple times in quick succesion in console.log
Send a tx with the wallet and note the same
Test with eToken
Reviewers: #bitcoin_abc, emack
Reviewed By: #bitcoin_abc, emack
Subscribers: emack
Differential Revision: https://reviews.bitcoinabc.org/D11673