diff options
| author | Matt Corallo <[email protected]> | 2017-06-08 11:05:18 -0400 |
|---|---|---|
| committer | Matt Corallo <[email protected]> | 2017-10-13 19:29:54 -0400 |
| commit | 0343676ce32ef69b25bada101223b92f92da158a (patch) | |
| tree | 6ce316c85afe8884c123c1226d0b4a2f8b89df32 /src/validationinterface.cpp | |
| parent | Add a CValidationInterface::TransactionRemovedFromMempool (diff) | |
| download | discoin-0343676ce32ef69b25bada101223b92f92da158a.tar.xz discoin-0343676ce32ef69b25bada101223b92f92da158a.zip | |
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).
Diffstat (limited to 'src/validationinterface.cpp')
| -rw-r--r-- | src/validationinterface.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/validationinterface.cpp b/src/validationinterface.cpp index 24f2b96c7..b4efbe6ef 100644 --- a/src/validationinterface.cpp +++ b/src/validationinterface.cpp @@ -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); + }); } } |