Add an interface to get the queue depth out of CValidationInterface
This commit is contained in:
parent
a99b76f269
commit
5a933cefcc
4 changed files with 14 additions and 0 deletions
|
@ -206,3 +206,8 @@ void SingleThreadedSchedulerClient::EmptyQueue() {
|
||||||
should_continue = !m_callbacks_pending.empty();
|
should_continue = !m_callbacks_pending.empty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t SingleThreadedSchedulerClient::CallbacksPending() {
|
||||||
|
LOCK(m_cs_callbacks_pending);
|
||||||
|
return m_callbacks_pending.size();
|
||||||
|
}
|
||||||
|
|
|
@ -108,6 +108,8 @@ public:
|
||||||
// Processes all remaining queue members on the calling thread, blocking until queue is empty
|
// Processes all remaining queue members on the calling thread, blocking until queue is empty
|
||||||
// Must be called after the CScheduler has no remaining processing threads!
|
// Must be called after the CScheduler has no remaining processing threads!
|
||||||
void EmptyQueue();
|
void EmptyQueue();
|
||||||
|
|
||||||
|
size_t CallbacksPending();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -54,6 +54,11 @@ void CMainSignals::FlushBackgroundCallbacks() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t CMainSignals::CallbacksPending() {
|
||||||
|
if (!m_internals) return 0;
|
||||||
|
return m_internals->m_schedulerClient.CallbacksPending();
|
||||||
|
}
|
||||||
|
|
||||||
void CMainSignals::RegisterWithMempoolSignals(CTxMemPool& pool) {
|
void CMainSignals::RegisterWithMempoolSignals(CTxMemPool& pool) {
|
||||||
pool.NotifyEntryRemoved.connect(boost::bind(&CMainSignals::MempoolEntryRemoved, this, _1, _2));
|
pool.NotifyEntryRemoved.connect(boost::bind(&CMainSignals::MempoolEntryRemoved, this, _1, _2));
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,6 +131,8 @@ public:
|
||||||
/** Call any remaining callbacks on the calling thread */
|
/** Call any remaining callbacks on the calling thread */
|
||||||
void FlushBackgroundCallbacks();
|
void FlushBackgroundCallbacks();
|
||||||
|
|
||||||
|
size_t CallbacksPending();
|
||||||
|
|
||||||
/** Register with mempool to call TransactionRemovedFromMempool callbacks */
|
/** Register with mempool to call TransactionRemovedFromMempool callbacks */
|
||||||
void RegisterWithMempoolSignals(CTxMemPool& pool);
|
void RegisterWithMempoolSignals(CTxMemPool& pool);
|
||||||
/** Unregister with mempool */
|
/** Unregister with mempool */
|
||||||
|
|
Loading…
Reference in a new issue