HomePhabricator

[Cashtab] Update ws onmessage handler so latest cashtabState is always available

Description

[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

Details

Provenance
bytesofmanAuthored on Mar 18 2024, 18:50
bytesofmanPushed on Mar 19 2024, 08:23
Reviewer
Restricted Project
Differential Revision
D15728: [Cashtab] Update ws onmessage handler so latest cashtabState is always available
Parents
rABCa8e8f277059d: [chronik] Make chronik_serve bind once to the same ip
Branches
Unknown
Tags
Unknown