Changeset View
Changeset View
Standalone View
Standalone View
src/qt/walletmodel.cpp
// Copyright (c) 2011-2016 The Bitcoin Core developers | // Copyright (c) 2011-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <qt/walletmodel.h> | #include <qt/walletmodel.h> | ||||
#include <chain.h> | |||||
#include <config.h> | #include <config.h> | ||||
#include <consensus/validation.h> | |||||
#include <dstencode.h> | #include <dstencode.h> | ||||
#include <interfaces/handler.h> | #include <interfaces/handler.h> | ||||
#include <interfaces/node.h> | #include <interfaces/node.h> | ||||
#include <keystore.h> | |||||
#include <net.h> // for g_connman | |||||
#include <qt/addresstablemodel.h> | #include <qt/addresstablemodel.h> | ||||
#include <qt/guiconstants.h> | #include <qt/guiconstants.h> | ||||
#include <qt/guiutil.h> | |||||
#include <qt/paymentserver.h> | #include <qt/paymentserver.h> | ||||
#include <qt/recentrequeststablemodel.h> | #include <qt/recentrequeststablemodel.h> | ||||
#include <qt/transactiontablemodel.h> | #include <qt/transactiontablemodel.h> | ||||
#include <sync.h> | |||||
#include <ui_interface.h> | #include <ui_interface.h> | ||||
#include <util.h> // for GetBoolArg | #include <util.h> // for GetBoolArg | ||||
#include <validation.h> | |||||
#include <wallet/coincontrol.h> | #include <wallet/coincontrol.h> | ||||
#include <wallet/wallet.h> | #include <wallet/wallet.h> | ||||
#include <wallet/walletdb.h> // for BackupWallet | |||||
#include <QDebug> | #include <QDebug> | ||||
#include <QSet> | #include <QSet> | ||||
#include <QTimer> | #include <QTimer> | ||||
#include <cstdint> | #include <cstdint> | ||||
WalletModel::WalletModel(std::unique_ptr<interfaces::Wallet> wallet, | WalletModel::WalletModel(std::unique_ptr<interfaces::Wallet> wallet, | ||||
interfaces::Node &node, | interfaces::Node &node, | ||||
const PlatformStyle *platformStyle, CWallet *_wallet, | const PlatformStyle *platformStyle, | ||||
OptionsModel *_optionsModel, QObject *parent) | OptionsModel *_optionsModel, QObject *parent) | ||||
: QObject(parent), m_wallet(std::move(wallet)), m_node(node), | : QObject(parent), m_wallet(std::move(wallet)), m_node(node), | ||||
cwallet(_wallet), optionsModel(_optionsModel), addressTableModel(0), | optionsModel(_optionsModel), addressTableModel(0), | ||||
transactionTableModel(0), recentRequestsTableModel(0), | transactionTableModel(0), recentRequestsTableModel(0), | ||||
cachedEncryptionStatus(Unencrypted), cachedNumBlocks(0) { | cachedEncryptionStatus(Unencrypted), cachedNumBlocks(0) { | ||||
fHaveWatchOnly = m_wallet->haveWatchOnly(); | fHaveWatchOnly = m_wallet->haveWatchOnly(); | ||||
fForceCheckBalanceChanged = false; | fForceCheckBalanceChanged = false; | ||||
addressTableModel = new AddressTableModel(this); | addressTableModel = new AddressTableModel(this); | ||||
transactionTableModel = | transactionTableModel = new TransactionTableModel(platformStyle, this); | ||||
new TransactionTableModel(platformStyle, cwallet, this); | recentRequestsTableModel = new RecentRequestsTableModel(this); | ||||
recentRequestsTableModel = new RecentRequestsTableModel(cwallet, this); | |||||
// This timer will be fired repeatedly to update the balance | // This timer will be fired repeatedly to update the balance | ||||
pollTimer = new QTimer(this); | pollTimer = new QTimer(this); | ||||
connect(pollTimer, SIGNAL(timeout()), this, SLOT(pollBalanceChanged())); | connect(pollTimer, SIGNAL(timeout()), this, SLOT(pollBalanceChanged())); | ||||
pollTimer->start(MODEL_UPDATE_DELAY); | pollTimer->start(MODEL_UPDATE_DELAY); | ||||
subscribeToCoreSignals(); | subscribeToCoreSignals(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 433 Lines • Show Last 20 Lines |