HomePhabricator

Hold mempool.cs for the duration of ATMP.

Description

Hold mempool.cs for the duration of ATMP.

Summary:
This resolves an issue where getrawmempool() can race mempool
notification signals. Intuitively we use mempool.cs as a "read
lock" on the mempool with cs_main being the write lock, so holding
the read lock intermittently while doing write operations is
somewhat strange.
This also avoids the introduction of cs_main in getrawmempool()
which reviewers objected to in the previous fix in #12273

This backports core PR12368

Test Plan:

make check

Reviewers: #bitcoin_abc, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Subscribers: teamcity

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

Details

Provenance
Matt Corallo <git@bluematt.me>Authored on Feb 6 2018, 18:51
deadalnixCommitted on Sep 6 2018, 22:08
jasonbcoxPushed on Sep 7 2018, 00:05
Reviewer
Restricted Project
Differential Revision
D1733: Hold mempool.cs for the duration of ATMP.
Parents
rSTAGING8715a49be63b: Fix importmulti failure to return rescan errors
Branches
Unknown
Tags
Unknown