HomePhabricator

[avalanche] Fix a lock-order issue when adding a tx to the poll

Description

[avalanche] Fix a lock-order issue when adding a tx to the poll

Summary:
This fixes a lock order inversion cs_main => voteRecords => cs_main.
We can't call addToReconcile with cs_main hold.

Unfortunately annotating for !cs_main everywhere is not really practicable as it would propagate to all callsites recursively.

Test Plan:

./contrib/teamcity/build-configurations.py build-tsan

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

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

Details

Provenance
FabienAuthored on Sep 18 2024, 08:30
FabienPushed on Sep 18 2024, 11:57
Reviewer
Restricted Project
Differential Revision
D16776: [avalanche] Fix a lock-order issue when adding a tx to the poll
Parents
rABC6e61b8cf6581: [avalanche] Vote on conflicting txs
Branches
Unknown
Tags
Unknown