Skip to content

Commit

Permalink
Merge bitcoin#12842: Prevent concurrent savemempool
Browse files Browse the repository at this point in the history
585b47c rpc: Prevent concurrent savemempool (João Barbosa)

Pull request description:

  Follow up of bitcoin#12172, this change prevents calling `savemempool` RPC concurrently.

Tree-SHA512: 4759a7107658a9794f5c6ab7e3e3002276abadd64996010be67a2791914d284db6fe0377c071a8d6a42387bfb0178f219b73aeec077ce5c4fe5c634a30b3e081
  • Loading branch information
laanwj authored and PastaPastaPasta committed Jun 28, 2021
1 parent 931802b commit 9cbcb96
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/validation.cpp
Expand Up @@ -5296,6 +5296,9 @@ bool DumpMempool(void)
std::map<uint256, CAmount> mapDeltas;
std::vector<TxMempoolInfo> vinfo;

static Mutex dump_mutex;
LOCK(dump_mutex);

{
LOCK(mempool.cs);
for (const auto &i : mempool.mapDeltas) {
Expand Down

0 comments on commit 9cbcb96

Please sign in to comment.