HomePhabricator

[alias-server] Prevent reentrency in handleBlockConnected

Description

[alias-server] Prevent reentrency in handleBlockConnected

Summary:
T3060

Implement async-lock to prevent reentrancy in handleBlockConnected

If handleBlockConnected is called by parseWebsocketMessage and is already processing, the next call will wait until the first call completes

Test Plan:
Review new unit test
npm test
Note: this unit test is something of a stub right now. It will matter more when we are actually updating and changing the database. This is where we will be able to actually verify no reentrancy.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D13688

Details

Provenance
bytesofmanAuthored on Apr 12 2023, 16:58
bytesofmanPushed on Apr 13 2023, 11:45
Reviewer
Restricted Project
Differential Revision
D13688: [alias-server] Prevent reentrency in handleBlockConnected
Parents
rABCf228133d37db: [CI] Use 80 as a default port for previews
Branches
Unknown
Tags
Unknown