dogecoin/src/validationinterface.cpp
Patrick Lodder 90373b711e
wallet: remove misleading information about transaction state
Qt wallets display information to users about the broadcast state
of transactions, without truly knowing the actual state. The fact
that a peer has requested details for a transaction does not mean
it was accepted to their mempool or relayed to any other peers and
miners, because the only way to test if the transaction can be
accepted is by requesting and processing it.

We remove the "offline" and "maturity warning" statuses, which
saves large wallets memory and processing time.

Backported from: beef7ec4
Original author: Matt Corallo <git@bluematt.me>
2022-06-21 16:36:19 +02:00

83 lines
5.1 KiB
C++

// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2016 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "validationinterface.h"
#include <boost/bind/bind.hpp>
static CMainSignals g_signals;
CMainSignals& GetMainSignals()
{
return g_signals;
}
void RegisterValidationInterface(CValidationInterface* pwalletIn) {
g_signals.UpdatedBlockTip.connect(boost::bind(&CValidationInterface::UpdatedBlockTip,
pwalletIn, boost::placeholders::_1,
boost::placeholders::_2,
boost::placeholders::_3));
g_signals.SyncTransaction.connect(boost::bind(&CValidationInterface::SyncTransaction,
pwalletIn, boost::placeholders::_1,
boost::placeholders::_2,
boost::placeholders::_3));
g_signals.UpdatedTransaction.connect(boost::bind(&CValidationInterface::UpdatedTransaction,
pwalletIn, boost::placeholders::_1));
g_signals.SetBestChain.connect(boost::bind(&CValidationInterface::SetBestChain,
pwalletIn, boost::placeholders::_1));
g_signals.Broadcast.connect(boost::bind(&CValidationInterface::ResendWalletTransactions,
pwalletIn, boost::placeholders::_1, boost::placeholders::_2));
g_signals.BlockChecked.connect(boost::bind(&CValidationInterface::BlockChecked,
pwalletIn, boost::placeholders::_1,
boost::placeholders::_2));
g_signals.ScriptForMining.connect(boost::bind(&CValidationInterface::GetScriptForMining,
pwalletIn, boost::placeholders::_1));
g_signals.BlockFound.connect(boost::bind(&CValidationInterface::ResetRequestCount,
pwalletIn, boost::placeholders::_1));
g_signals.NewPoWValidBlock.connect(boost::bind(&CValidationInterface::NewPoWValidBlock,
pwalletIn, boost::placeholders::_1,
boost::placeholders::_2));
}
void UnregisterValidationInterface(CValidationInterface* pwalletIn) {
g_signals.BlockFound.disconnect(boost::bind(&CValidationInterface::ResetRequestCount,
pwalletIn, boost::placeholders::_1));
g_signals.ScriptForMining.disconnect(boost::bind(&CValidationInterface::GetScriptForMining,
pwalletIn, boost::placeholders::_1));
g_signals.BlockChecked.disconnect(boost::bind(&CValidationInterface::BlockChecked,
pwalletIn, boost::placeholders::_1,
boost::placeholders::_2));
g_signals.Broadcast.disconnect(boost::bind(&CValidationInterface::ResendWalletTransactions,
pwalletIn, boost::placeholders::_1,
boost::placeholders::_2));
g_signals.SetBestChain.disconnect(boost::bind(&CValidationInterface::SetBestChain,
pwalletIn, boost::placeholders::_1));
g_signals.UpdatedTransaction.disconnect(boost::bind(&CValidationInterface::UpdatedTransaction,
pwalletIn, boost::placeholders::_1));
g_signals.SyncTransaction.disconnect(boost::bind(&CValidationInterface::SyncTransaction,
pwalletIn, boost::placeholders::_1,
boost::placeholders::_2,
boost::placeholders::_3));
g_signals.UpdatedBlockTip.disconnect(boost::bind(&CValidationInterface::UpdatedBlockTip,
pwalletIn, boost::placeholders::_1,
boost::placeholders::_2,
boost::placeholders::_3));
g_signals.NewPoWValidBlock.disconnect(boost::bind(&CValidationInterface::NewPoWValidBlock,
pwalletIn, boost::placeholders::_1,
boost::placeholders::_2));
}
void UnregisterAllValidationInterfaces() {
g_signals.BlockFound.disconnect_all_slots();
g_signals.ScriptForMining.disconnect_all_slots();
g_signals.BlockChecked.disconnect_all_slots();
g_signals.Broadcast.disconnect_all_slots();
g_signals.SetBestChain.disconnect_all_slots();
g_signals.UpdatedTransaction.disconnect_all_slots();
g_signals.SyncTransaction.disconnect_all_slots();
g_signals.UpdatedBlockTip.disconnect_all_slots();
g_signals.NewPoWValidBlock.disconnect_all_slots();
}