aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-10-24 15:19:44 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2018-10-24 15:20:33 +0200
commit2e15fa16cd3b5badefc00466a67611f0f06d81db (patch)
treeb2ad0f9247d68a8b4869b0b99ccc7f5bc40ca5b7
parent9dda5fdf64ca07079a9bd6d3102d281074a9a912 (diff)
parent585b47cfe133fae112782ad0a88fe25c71d465fa (diff)
Merge #12842: Prevent concurrent savemempool
585b47cfe133fae112782ad0a88fe25c71d465fa rpc: Prevent concurrent savemempool (João Barbosa) Pull request description: Follow up of #12172, this change prevents calling `savemempool` RPC concurrently. Tree-SHA512: 4759a7107658a9794f5c6ab7e3e3002276abadd64996010be67a2791914d284db6fe0377c071a8d6a42387bfb0178f219b73aeec077ce5c4fe5c634a30b3e081
-rw-r--r--src/validation.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 80ae2428dc..29804c5e10 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -4766,6 +4766,9 @@ bool DumpMempool()
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) {