[Cashtab] Update ws onmessage handler so latest cashtabState is always available
Summary:
The onMessage routine for the websocket does not have access to the latest state variables. It has access to state variables when the onMessage routine was set.
So, we need to update the onMessage routine whenever state variables important to this routine change. Since we are updating cashtabState whenever we send or receive a tx -- we should update the onMessage routine to include the current cashtabState whenever cashtabState changes.
This patches an issue described in feedback on D15701
Test Plan: npm test
Reviewers: #bitcoin_abc, emack
Reviewed By: #bitcoin_abc, emack
Subscribers: emack
Differential Revision: https://reviews.bitcoinabc.org/D15728