|
|
|
@ -38,14 +38,15 @@
|
|
|
|
|
WalletModel::WalletModel(std::unique_ptr<interfaces::Wallet> wallet, ClientModel& client_model, const PlatformStyle *platformStyle, QObject *parent) :
|
|
|
|
|
QObject(parent),
|
|
|
|
|
m_wallet(std::move(wallet)),
|
|
|
|
|
m_client_model(client_model),
|
|
|
|
|
m_client_model(&client_model),
|
|
|
|
|
m_node(client_model.node()),
|
|
|
|
|
optionsModel(client_model.getOptionsModel()),
|
|
|
|
|
addressTableModel(nullptr),
|
|
|
|
|
transactionTableModel(nullptr),
|
|
|
|
|
recentRequestsTableModel(nullptr),
|
|
|
|
|
cachedEncryptionStatus(Unencrypted),
|
|
|
|
|
cachedNumBlocks(0)
|
|
|
|
|
cachedNumBlocks(0),
|
|
|
|
|
timer(new QTimer(this))
|
|
|
|
|
{
|
|
|
|
|
fHaveWatchOnly = m_wallet->haveWatchOnly();
|
|
|
|
|
addressTableModel = new AddressTableModel(this);
|
|
|
|
@ -63,11 +64,16 @@ WalletModel::~WalletModel()
|
|
|
|
|
void WalletModel::startPollBalance()
|
|
|
|
|
{
|
|
|
|
|
// This timer will be fired repeatedly to update the balance
|
|
|
|
|
QTimer* timer = new QTimer(this);
|
|
|
|
|
connect(timer, &QTimer::timeout, this, &WalletModel::pollBalanceChanged);
|
|
|
|
|
timer->start(MODEL_UPDATE_DELAY);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WalletModel::setClientModel(ClientModel* client_model)
|
|
|
|
|
{
|
|
|
|
|
m_client_model = client_model;
|
|
|
|
|
if (!m_client_model) timer->stop();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WalletModel::updateStatus()
|
|
|
|
|
{
|
|
|
|
|
EncryptionStatus newEncryptionStatus = getEncryptionStatus();
|
|
|
|
|