|
|
|
@ -11,9 +11,11 @@
|
|
|
|
|
#include <sync.h>
|
|
|
|
|
#include <txmempool.h>
|
|
|
|
|
#include <util.h>
|
|
|
|
|
#include <validation.h>
|
|
|
|
|
|
|
|
|
|
#include <list>
|
|
|
|
|
#include <atomic>
|
|
|
|
|
#include <future>
|
|
|
|
|
|
|
|
|
|
#include <boost/signals2/signal.hpp>
|
|
|
|
|
|
|
|
|
@ -118,6 +120,16 @@ void CallFunctionInValidationInterfaceQueue(std::function<void ()> func) {
|
|
|
|
|
g_signals.m_internals->m_schedulerClient.AddToProcessQueue(std::move(func));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SyncWithValidationInterfaceQueue() {
|
|
|
|
|
AssertLockNotHeld(cs_main);
|
|
|
|
|
// Block until the validation queue drains
|
|
|
|
|
std::promise<void> promise;
|
|
|
|
|
CallFunctionInValidationInterfaceQueue([&promise] {
|
|
|
|
|
promise.set_value();
|
|
|
|
|
});
|
|
|
|
|
promise.get_future().wait();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CMainSignals::MempoolEntryRemoved(CTransactionRef ptx, MemPoolRemovalReason reason) {
|
|
|
|
|
if (reason != MemPoolRemovalReason::BLOCK && reason != MemPoolRemovalReason::CONFLICT) {
|
|
|
|
|
m_internals->m_schedulerClient.AddToProcessQueue([ptx, this] {
|
|
|
|
|