mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge #739: Take mempool locks when doing compact block RPC calls touching mempool
67a669e69 Take mempool locks when doing compact block RPC calls touching mempool (Gregory Sanders)
Pull request description:
This may help reduce the failures in `feature_blocksign.py` that seem to occur fairly often. It could be that the mempool is in an inconsistent state, which messed up compact block finalization.
Tree-SHA512: cd066933cf58b3c57869db3fd97c2de0ff554d442e91051f43626b12778d55835065ad5fc42fed09b7750796e9e0b2e6947f1ac54e02fe4c8e2a84fe340429ae
This commit is contained in:
commit
81fd79ab94
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