mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-31 02:46:01 +02:00
refactor: Use boost::scoped_connection in signal/slot, also prefer range-based loop instead of std::transform
This commit is contained in:
@@ -2368,14 +2368,11 @@ class ConnectTrace {
|
||||
private:
|
||||
std::vector<PerBlockConnectTrace> blocksConnected;
|
||||
CTxMemPool &pool;
|
||||
boost::signals2::scoped_connection m_connNotifyEntryRemoved;
|
||||
|
||||
public:
|
||||
explicit ConnectTrace(CTxMemPool &_pool) : blocksConnected(1), pool(_pool) {
|
||||
pool.NotifyEntryRemoved.connect(boost::bind(&ConnectTrace::NotifyEntryRemoved, this, _1, _2));
|
||||
}
|
||||
|
||||
~ConnectTrace() {
|
||||
pool.NotifyEntryRemoved.disconnect(boost::bind(&ConnectTrace::NotifyEntryRemoved, this, _1, _2));
|
||||
m_connNotifyEntryRemoved = pool.NotifyEntryRemoved.connect(boost::bind(&ConnectTrace::NotifyEntryRemoved, this, _1, _2));
|
||||
}
|
||||
|
||||
void BlockConnected(CBlockIndex* pindex, std::shared_ptr<const CBlock> pblock) {
|
||||
|
||||
Reference in New Issue
Block a user