Skip to content

Commit 1b396b8

Browse files
committed
Move NotifyEntryRemoved to use the general interfaces::MakeHandler
1 parent 4cb5820 commit 1b396b8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/validation.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
#include "guiinterface.h"
2727
#include "init.h"
2828
#include "invalid.h"
29+
#include "interfaces/handler.h"
2930
#include "legacy/validation_zerocoin_legacy.h"
30-
#include "libzerocoin/Denominations.h"
3131
#include "kernel.h"
3232
#include "masternode-payments.h"
3333
#include "masternode-sync.h"
@@ -186,10 +186,11 @@ class MemPoolConflictRemovalTracker
186186
private:
187187
std::vector<CTransactionRef> conflictedTxs;
188188
CTxMemPool &pool;
189+
std::unique_ptr<interfaces::Handler> m_handler_notify_entry_removed;
189190

190191
public:
191192
MemPoolConflictRemovalTracker(CTxMemPool &_pool) : pool(_pool) {
192-
pool.NotifyEntryRemoved.connect(std::bind(&MemPoolConflictRemovalTracker::NotifyEntryRemoved, this, std::placeholders::_1, std::placeholders::_2));
193+
m_handler_notify_entry_removed = interfaces::MakeHandler(pool.NotifyEntryRemoved.connect(std::bind(&MemPoolConflictRemovalTracker::NotifyEntryRemoved, this, std::placeholders::_1, std::placeholders::_2)));
193194
}
194195

195196
void NotifyEntryRemoved(CTransactionRef txRemoved, MemPoolRemovalReason reason) {
@@ -199,7 +200,7 @@ class MemPoolConflictRemovalTracker
199200
}
200201

201202
~MemPoolConflictRemovalTracker() {
202-
pool.NotifyEntryRemoved.disconnect(std::bind(&MemPoolConflictRemovalTracker::NotifyEntryRemoved, this, std::placeholders::_1, std::placeholders::_2));
203+
m_handler_notify_entry_removed->disconnect();
203204
for (const auto& tx : conflictedTxs) {
204205
GetMainSignals().SyncTransaction(*tx, nullptr, CMainSignals::SYNC_TRANSACTION_NOT_IN_BLOCK);
205206
}

0 commit comments

Comments
 (0)