2015-02-05 01:11:44 +01:00
|
|
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
2016-12-31 19:01:21 +01:00
|
|
|
// Copyright (c) 2009-2016 The Bitcoin Core developers
|
2015-02-05 01:11:44 +01:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
#include "validationinterface.h"
|
|
|
|
|
|
|
|
static CMainSignals g_signals;
|
|
|
|
|
|
|
|
CMainSignals& GetMainSignals()
|
|
|
|
{
|
|
|
|
return g_signals;
|
|
|
|
}
|
|
|
|
|
|
|
|
void RegisterValidationInterface(CValidationInterface* pwalletIn) {
|
2016-09-30 23:40:03 +02:00
|
|
|
g_signals.UpdatedBlockTip.connect(boost::bind(&CValidationInterface::UpdatedBlockTip, pwalletIn, _1, _2, _3));
|
2017-03-30 03:12:42 +02:00
|
|
|
g_signals.TransactionAddedToMempool.connect(boost::bind(&CValidationInterface::TransactionAddedToMempool, pwalletIn, _1));
|
|
|
|
g_signals.BlockConnected.connect(boost::bind(&CValidationInterface::BlockConnected, pwalletIn, _1, _2, _3));
|
|
|
|
g_signals.BlockDisconnected.connect(boost::bind(&CValidationInterface::BlockDisconnected, pwalletIn, _1));
|
2015-02-05 01:11:44 +01:00
|
|
|
g_signals.SetBestChain.connect(boost::bind(&CValidationInterface::SetBestChain, pwalletIn, _1));
|
|
|
|
g_signals.Inventory.connect(boost::bind(&CValidationInterface::Inventory, pwalletIn, _1));
|
2016-05-25 02:56:17 +02:00
|
|
|
g_signals.Broadcast.connect(boost::bind(&CValidationInterface::ResendWalletTransactions, pwalletIn, _1, _2));
|
2015-02-05 01:11:44 +01:00
|
|
|
g_signals.BlockChecked.connect(boost::bind(&CValidationInterface::BlockChecked, pwalletIn, _1, _2));
|
2016-12-19 08:26:20 +01:00
|
|
|
g_signals.NewPoWValidBlock.connect(boost::bind(&CValidationInterface::NewPoWValidBlock, pwalletIn, _1, _2));
|
2015-02-05 01:11:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void UnregisterValidationInterface(CValidationInterface* pwalletIn) {
|
|
|
|
g_signals.BlockChecked.disconnect(boost::bind(&CValidationInterface::BlockChecked, pwalletIn, _1, _2));
|
2016-05-25 02:56:17 +02:00
|
|
|
g_signals.Broadcast.disconnect(boost::bind(&CValidationInterface::ResendWalletTransactions, pwalletIn, _1, _2));
|
2015-02-05 01:11:44 +01:00
|
|
|
g_signals.Inventory.disconnect(boost::bind(&CValidationInterface::Inventory, pwalletIn, _1));
|
|
|
|
g_signals.SetBestChain.disconnect(boost::bind(&CValidationInterface::SetBestChain, pwalletIn, _1));
|
2017-03-30 03:12:42 +02:00
|
|
|
g_signals.TransactionAddedToMempool.disconnect(boost::bind(&CValidationInterface::TransactionAddedToMempool, pwalletIn, _1));
|
|
|
|
g_signals.BlockConnected.disconnect(boost::bind(&CValidationInterface::BlockConnected, pwalletIn, _1, _2, _3));
|
|
|
|
g_signals.BlockDisconnected.disconnect(boost::bind(&CValidationInterface::BlockDisconnected, pwalletIn, _1));
|
2016-09-30 23:40:03 +02:00
|
|
|
g_signals.UpdatedBlockTip.disconnect(boost::bind(&CValidationInterface::UpdatedBlockTip, pwalletIn, _1, _2, _3));
|
2016-12-19 08:26:20 +01:00
|
|
|
g_signals.NewPoWValidBlock.disconnect(boost::bind(&CValidationInterface::NewPoWValidBlock, pwalletIn, _1, _2));
|
2015-02-05 01:11:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void UnregisterAllValidationInterfaces() {
|
|
|
|
g_signals.BlockChecked.disconnect_all_slots();
|
|
|
|
g_signals.Broadcast.disconnect_all_slots();
|
|
|
|
g_signals.Inventory.disconnect_all_slots();
|
|
|
|
g_signals.SetBestChain.disconnect_all_slots();
|
2017-03-30 03:12:42 +02:00
|
|
|
g_signals.TransactionAddedToMempool.disconnect_all_slots();
|
|
|
|
g_signals.BlockConnected.disconnect_all_slots();
|
|
|
|
g_signals.BlockDisconnected.disconnect_all_slots();
|
2015-05-07 16:49:00 +02:00
|
|
|
g_signals.UpdatedBlockTip.disconnect_all_slots();
|
2016-12-19 08:26:20 +01:00
|
|
|
g_signals.NewPoWValidBlock.disconnect_all_slots();
|
2015-02-05 01:11:44 +01:00
|
|
|
}
|