mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Call TransactionRemovedFromMempool in the CScheduler thread
This is both good practice (we want to move all such callbacks into a background thread eventually) and prevents a lock inversion when we go to use this in wallet (mempool.cs->cs_wallet and cs_wallet->mempool.cs would otherwise both be used).
This commit is contained in:
@@ -106,7 +106,9 @@ void UnregisterAllValidationInterfaces() {
|
||||
|
||||
void CMainSignals::MempoolEntryRemoved(CTransactionRef ptx, MemPoolRemovalReason reason) {
|
||||
if (reason != MemPoolRemovalReason::BLOCK && reason != MemPoolRemovalReason::CONFLICT) {
|
||||
m_internals->TransactionRemovedFromMempool(ptx);
|
||||
m_internals->m_schedulerClient.AddToProcessQueue([ptx, this] {
|
||||
m_internals->TransactionRemovedFromMempool(ptx);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user