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
This commit is contained in:
Wladimir J. van der Laan 2018-10-24 15:19:44 +02:00 committed by pasta
parent 787113a778
commit 77b76ef0a5

View File

@ -5240,6 +5240,9 @@ bool DumpMempool(void)
std::map<uint256, CAmount> mapDeltas; std::map<uint256, CAmount> mapDeltas;
std::vector<TxMempoolInfo> vinfo; std::vector<TxMempoolInfo> vinfo;
static Mutex dump_mutex;
LOCK(dump_mutex);
{ {
LOCK(mempool.cs); LOCK(mempool.cs);
for (const auto &i : mempool.mapDeltas) { for (const auto &i : mempool.mapDeltas) {