mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Take mempool locks when doing compact block RPC calls touching mempool
This commit is contained in:
parent
ee14d88de2
commit
67a669e692
1 changed files with 2 additions and 0 deletions
|
|
@ -1245,6 +1245,7 @@ UniValue consumecompactsketch(const JSONRPCRequest& request)
|
|||
CBlockHeaderAndShortTxIDs cmpctblock;
|
||||
ssBlock >> cmpctblock;
|
||||
|
||||
LOCK(mempool.cs);
|
||||
PartiallyDownloadedBlock partialBlock(&mempool);
|
||||
const std::vector<std::pair<uint256, CTransactionRef>> dummy;
|
||||
ReadStatus status = partialBlock.InitData(cmpctblock, dummy);
|
||||
|
|
@ -1376,6 +1377,7 @@ UniValue finalizecompactblock(const JSONRPCRequest& request)
|
|||
found.insert(found.end(), transactions.txn.begin(), transactions.txn.end());
|
||||
|
||||
// Now construct the final block!
|
||||
LOCK(mempool.cs);
|
||||
PartiallyDownloadedBlock partialBlock(&mempool);
|
||||
|
||||
const std::vector<std::pair<uint256, CTransactionRef>> dummy;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue