Bitcoin ABC  0.22.12
P2P Digital Currency
walletmodel.cpp
Go to the documentation of this file.
1 // Copyright (c) 2011-2019 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #include <qt/walletmodel.h>
6 
7 #include <cashaddrenc.h>
8 #include <interfaces/handler.h>
9 #include <interfaces/node.h>
10 #include <key_io.h>
11 #include <node/ui_interface.h>
12 #include <psbt.h>
13 #include <qt/addresstablemodel.h>
14 #include <qt/clientmodel.h>
15 #include <qt/guiconstants.h>
16 #include <qt/paymentserver.h>
19 #include <util/system.h> // for GetBoolArg
20 #include <util/translation.h>
21 #include <wallet/coincontrol.h>
22 #include <wallet/wallet.h> // for CRecipient
23 
24 #include <QDebug>
25 #include <QSet>
26 #include <QTimer>
27 
28 #include <cstdint>
29 
30 WalletModel::WalletModel(std::unique_ptr<interfaces::Wallet> wallet,
31  ClientModel &client_model,
32  const PlatformStyle *platformStyle, QObject *parent)
33  : QObject(parent), m_wallet(std::move(wallet)),
34  m_client_model(client_model), m_node(client_model.node()),
35  optionsModel(client_model.getOptionsModel()), addressTableModel(nullptr),
36  transactionTableModel(nullptr), recentRequestsTableModel(nullptr),
37  cachedEncryptionStatus(Unencrypted), cachedNumBlocks(0) {
38  fHaveWatchOnly = m_wallet->haveWatchOnly();
40  transactionTableModel = new TransactionTableModel(platformStyle, this);
42 
44 }
45 
48 }
49 
51  // This timer will be fired repeatedly to update the balance
52  QTimer *timer = new QTimer(this);
53  connect(timer, &QTimer::timeout, this, &WalletModel::pollBalanceChanged);
54  timer->start(MODEL_UPDATE_DELAY);
55 }
56 
58  EncryptionStatus newEncryptionStatus = getEncryptionStatus();
59 
60  if (cachedEncryptionStatus != newEncryptionStatus) {
61  Q_EMIT encryptionStatusChanged();
62  }
63 }
64 
66  // Try to get balances and return early if locks can't be acquired. This
67  // avoids the GUI from getting stuck on periodical polls if the core is
68  // holding the locks for a longer time - for example, during a wallet
69  // rescan.
70  interfaces::WalletBalances new_balances;
71  int numBlocks = -1;
72  if (!m_wallet->tryGetBalances(new_balances, numBlocks,
74  return;
75  }
76 
78 
79  // Balance and number of transactions might have changed
80  cachedNumBlocks = numBlocks;
81 
82  checkBalanceChanged(new_balances);
85  }
86 }
87 
89  const interfaces::WalletBalances &new_balances) {
90  if (new_balances.balanceChanged(m_cached_balances)) {
91  m_cached_balances = new_balances;
92  Q_EMIT balanceChanged(new_balances);
93  }
94 }
95 
97  // Balance and number of transactions might have changed
99 }
100 
101 void WalletModel::updateAddressBook(const QString &address,
102  const QString &label, bool isMine,
103  const QString &purpose, int status) {
104  if (addressTableModel) {
105  addressTableModel->updateEntry(address, label, isMine, purpose, status);
106  }
107 }
108 
109 void WalletModel::updateWatchOnlyFlag(bool fHaveWatchonly) {
110  fHaveWatchOnly = fHaveWatchonly;
111  Q_EMIT notifyWatchonlyChanged(fHaveWatchonly);
112 }
113 
114 bool WalletModel::validateAddress(const QString &address) {
115  return IsValidDestinationString(address.toStdString(), getChainParams());
116 }
117 
120  const CCoinControl &coinControl) {
121  Amount total = Amount::zero();
122  bool fSubtractFeeFromAmount = false;
123  QList<SendCoinsRecipient> recipients = transaction.getRecipients();
124  std::vector<CRecipient> vecSend;
125 
126  if (recipients.empty()) {
127  return OK;
128  }
129 
130  // Used to detect duplicates
131  QSet<QString> setAddress;
132  int nAddresses = 0;
133 
134  // Pre-check input data for validity
135  for (const SendCoinsRecipient &rcp : recipients) {
136  if (rcp.fSubtractFeeFromAmount) {
137  fSubtractFeeFromAmount = true;
138  }
139 
140 #ifdef ENABLE_BIP70
141  // PaymentRequest...
142  if (rcp.paymentRequest.IsInitialized()) {
143  Amount subtotal = Amount::zero();
144  const payments::PaymentDetails &details =
145  rcp.paymentRequest.getDetails();
146  for (int i = 0; i < details.outputs_size(); i++) {
147  const payments::Output &out = details.outputs(i);
148  if (out.amount() <= 0) {
149  continue;
150  }
151 
152  subtotal += int64_t(out.amount()) * SATOSHI;
153  const uint8_t *scriptStr = (const uint8_t *)out.script().data();
154  CScript scriptPubKey(scriptStr,
155  scriptStr + out.script().size());
156  Amount nAmount = int64_t(out.amount()) * SATOSHI;
157  CRecipient recipient = {scriptPubKey, nAmount,
159  vecSend.push_back(recipient);
160  }
161 
162  if (subtotal <= Amount::zero()) {
163  return InvalidAmount;
164  }
165  total += subtotal;
166  }
167 
168  // User-entered bitcoin address / amount:
169  else
170 #endif
171  {
172  if (!validateAddress(rcp.address)) {
173  return InvalidAddress;
174  }
175  if (rcp.amount <= Amount::zero()) {
176  return InvalidAmount;
177  }
178  setAddress.insert(rcp.address);
179  ++nAddresses;
180 
181  CScript scriptPubKey = GetScriptForDestination(
182  DecodeDestination(rcp.address.toStdString(), getChainParams()));
183  CRecipient recipient = {scriptPubKey, Amount(rcp.amount),
184  rcp.fSubtractFeeFromAmount};
185  vecSend.push_back(recipient);
186 
187  total += rcp.amount;
188  }
189  }
190  if (setAddress.size() != nAddresses) {
191  return DuplicateAddress;
192  }
193 
194  Amount nBalance = m_wallet->getAvailableBalance(coinControl);
195 
196  if (total > nBalance) {
197  return AmountExceedsBalance;
198  }
199 
200  Amount nFeeRequired = Amount::zero();
201  int nChangePosRet = -1;
203 
204  auto &newTx = transaction.getWtx();
205  newTx = m_wallet->createTransaction(
206  vecSend, coinControl, !wallet().privateKeysDisabled() /* sign */,
207  nChangePosRet, nFeeRequired, error);
208  transaction.setTransactionFee(nFeeRequired);
209  if (fSubtractFeeFromAmount && newTx) {
210  transaction.reassignAmounts(nChangePosRet);
211  }
212 
213  if (!newTx) {
214  if (!fSubtractFeeFromAmount && (total + nFeeRequired) > nBalance) {
216  }
217  Q_EMIT message(tr("Send Coins"),
218  QString::fromStdString(error.translated),
221  }
222 
223  // Reject absurdly high fee. (This can never happen because the
224  // wallet never creates transactions with fee greater than
225  // m_default_max_tx_fee. This merely a belt-and-suspenders check).
226  if (nFeeRequired > m_wallet->getDefaultMaxTxFee()) {
227  return AbsurdFee;
228  }
229 
230  return SendCoinsReturn(OK);
231 }
232 
235  /* store serialized transaction */
236  QByteArray transaction_array;
237 
238  std::vector<std::pair<std::string, std::string>> vOrderForm;
239  for (const SendCoinsRecipient &rcp : transaction.getRecipients()) {
240 #ifdef ENABLE_BIP70
241  if (rcp.paymentRequest.IsInitialized()) {
242  // Make sure any payment requests involved are still valid.
243  if (PaymentServer::verifyExpired(rcp.paymentRequest.getDetails())) {
244  return PaymentRequestExpired;
245  }
246 
247  // Store PaymentRequests in wtx.vOrderForm in wallet.
248  std::string value;
249  rcp.paymentRequest.SerializeToString(&value);
250  vOrderForm.emplace_back("PaymentRequest", std::move(value));
251  } else
252 #endif
253  {
254  if (!rcp.message.isEmpty()) {
255  // Message from normal bitcoincash:URI
256  // (bitcoincash:123...?message=example)
257  vOrderForm.emplace_back("Message", rcp.message.toStdString());
258  }
259  }
260  }
261 
262  auto &newTx = transaction.getWtx();
263  wallet().commitTransaction(newTx, {} /* mapValue */, std::move(vOrderForm));
264 
266  ssTx << *newTx;
267  transaction_array.append(&(ssTx[0]), ssTx.size());
268 
269  // Add addresses / update labels that we've sent to the address book, and
270  // emit coinsSent signal for each recipient
271  for (const SendCoinsRecipient &rcp : transaction.getRecipients()) {
272  // Don't touch the address book when we have a payment request
273 #ifdef ENABLE_BIP70
274  if (!rcp.paymentRequest.IsInitialized())
275 #endif
276  {
277  std::string strAddress = rcp.address.toStdString();
278  CTxDestination dest =
279  DecodeDestination(strAddress, getChainParams());
280  std::string strLabel = rcp.label.toStdString();
281  // Check if we have a new address or an updated label
282  std::string name;
283  if (!m_wallet->getAddress(dest, &name, /* is_mine= */ nullptr,
284  /* purpose= */ nullptr)) {
285  m_wallet->setAddressBook(dest, strLabel, "send");
286  } else if (name != strLabel) {
287  // "" means don't change purpose
288  m_wallet->setAddressBook(dest, strLabel, "");
289  }
290  }
291  Q_EMIT coinsSent(this->wallet(), rcp, transaction_array);
292  }
293 
294  // update balance immediately, otherwise there could be a short noticeable
295  // delay until pollBalanceChanged hits
296  checkBalanceChanged(m_wallet->getBalances());
297 
298  return SendCoinsReturn(OK);
299 }
300 
302  return optionsModel;
303 }
304 
306  return addressTableModel;
307 }
308 
310  return transactionTableModel;
311 }
312 
315 }
316 
318  if (!m_wallet->isCrypted()) {
319  return Unencrypted;
320  } else if (m_wallet->isLocked()) {
321  return Locked;
322  } else {
323  return Unlocked;
324  }
325 }
326 
328  const SecureString &passphrase) {
329  if (encrypted) {
330  // Encrypt
331  return m_wallet->encryptWallet(passphrase);
332  } else {
333  // Decrypt -- TODO; not supported yet
334  return false;
335  }
336 }
337 
338 bool WalletModel::setWalletLocked(bool locked, const SecureString &passPhrase) {
339  if (locked) {
340  // Lock
341  return m_wallet->lock();
342  } else {
343  // Unlock
344  return m_wallet->unlock(passPhrase);
345  }
346 }
347 
349  const SecureString &newPass) {
350  // Make sure wallet is locked before attempting pass change
351  m_wallet->lock();
352  return m_wallet->changeWalletPassphrase(oldPass, newPass);
353 }
354 
355 // Handlers for core signals
356 static void NotifyUnload(WalletModel *walletModel) {
357  qDebug() << "NotifyUnload";
358  bool invoked = QMetaObject::invokeMethod(walletModel, "unload");
359  assert(invoked);
360 }
361 
362 static void NotifyKeyStoreStatusChanged(WalletModel *walletmodel) {
363  qDebug() << "NotifyKeyStoreStatusChanged";
364  bool invoked = QMetaObject::invokeMethod(walletmodel, "updateStatus",
365  Qt::QueuedConnection);
366  assert(invoked);
367 }
368 
369 static void NotifyAddressBookChanged(WalletModel *walletmodel,
370  const CTxDestination &address,
371  const std::string &label, bool isMine,
372  const std::string &purpose,
373  ChangeType status) {
374  QString strAddress = QString::fromStdString(
375  EncodeCashAddr(address, walletmodel->getChainParams()));
376  QString strLabel = QString::fromStdString(label);
377  QString strPurpose = QString::fromStdString(purpose);
378 
379  qDebug() << "NotifyAddressBookChanged: " + strAddress + " " + strLabel +
380  " isMine=" + QString::number(isMine) +
381  " purpose=" + strPurpose +
382  " status=" + QString::number(status);
383  bool invoked = QMetaObject::invokeMethod(
384  walletmodel, "updateAddressBook", Qt::QueuedConnection,
385  Q_ARG(QString, strAddress), Q_ARG(QString, strLabel),
386  Q_ARG(bool, isMine), Q_ARG(QString, strPurpose), Q_ARG(int, status));
387  assert(invoked);
388 }
389 
390 static void NotifyTransactionChanged(WalletModel *walletmodel, const TxId &hash,
391  ChangeType status) {
392  Q_UNUSED(hash);
393  Q_UNUSED(status);
394  bool invoked = QMetaObject::invokeMethod(walletmodel, "updateTransaction",
395  Qt::QueuedConnection);
396  assert(invoked);
397 }
398 
399 static void ShowProgress(WalletModel *walletmodel, const std::string &title,
400  int nProgress) {
401  // emits signal "showProgress"
402  bool invoked = QMetaObject::invokeMethod(
403  walletmodel, "showProgress", Qt::QueuedConnection,
404  Q_ARG(QString, QString::fromStdString(title)), Q_ARG(int, nProgress));
405  assert(invoked);
406 }
407 
408 static void NotifyWatchonlyChanged(WalletModel *walletmodel,
409  bool fHaveWatchonly) {
410  bool invoked = QMetaObject::invokeMethod(walletmodel, "updateWatchOnlyFlag",
411  Qt::QueuedConnection,
412  Q_ARG(bool, fHaveWatchonly));
413  assert(invoked);
414 }
415 
416 static void NotifyCanGetAddressesChanged(WalletModel *walletmodel) {
417  bool invoked =
418  QMetaObject::invokeMethod(walletmodel, "canGetAddressesChanged");
419  assert(invoked);
420 }
421 
423  // Connect signals to wallet
424  m_handler_unload = m_wallet->handleUnload(std::bind(&NotifyUnload, this));
425  m_handler_status_changed = m_wallet->handleStatusChanged(
426  std::bind(&NotifyKeyStoreStatusChanged, this));
427  m_handler_address_book_changed = m_wallet->handleAddressBookChanged(
428  std::bind(NotifyAddressBookChanged, this, std::placeholders::_1,
429  std::placeholders::_2, std::placeholders::_3,
430  std::placeholders::_4, std::placeholders::_5));
431  m_handler_transaction_changed = m_wallet->handleTransactionChanged(
432  std::bind(NotifyTransactionChanged, this, std::placeholders::_1,
433  std::placeholders::_2));
434  m_handler_show_progress = m_wallet->handleShowProgress(std::bind(
435  ShowProgress, this, std::placeholders::_1, std::placeholders::_2));
436  m_handler_watch_only_changed = m_wallet->handleWatchOnlyChanged(
437  std::bind(NotifyWatchonlyChanged, this, std::placeholders::_1));
438  m_handler_can_get_addrs_changed = m_wallet->handleCanGetAddressesChanged(
439  std::bind(NotifyCanGetAddressesChanged, this));
440 }
441 
443  // Disconnect signals from wallet
444  m_handler_unload->disconnect();
445  m_handler_status_changed->disconnect();
446  m_handler_address_book_changed->disconnect();
447  m_handler_transaction_changed->disconnect();
448  m_handler_show_progress->disconnect();
449  m_handler_watch_only_changed->disconnect();
450  m_handler_can_get_addrs_changed->disconnect();
451 }
452 
453 // WalletModel::UnlockContext implementation
455  bool was_locked = getEncryptionStatus() == Locked;
456  if (was_locked) {
457  // Request UI to unlock wallet
458  Q_EMIT requireUnlock();
459  }
460  // If wallet is still locked, unlock was failed or cancelled, mark context
461  // as invalid
462  bool valid = getEncryptionStatus() != Locked;
463 
464  return UnlockContext(this, valid, was_locked);
465 }
466 
468  bool _relock)
469  : wallet(_wallet), valid(_valid), relock(_relock) {}
470 
472  if (valid && relock) {
473  wallet->setWalletLocked(true);
474  }
475 }
476 
478  // Transfer context; old object no longer relocks wallet
479  *this = rhs;
480  rhs.relock = false;
481 }
482 
484  std::vector<std::string> &vReceiveRequests) {
485  // receive request
486  vReceiveRequests = m_wallet->getDestValues("rr");
487 }
488 
489 bool WalletModel::saveReceiveRequest(const std::string &sAddress,
490  const int64_t nId,
491  const std::string &sRequest) {
492  CTxDestination dest = DecodeDestination(sAddress, getChainParams());
493 
494  std::stringstream ss;
495  ss << nId;
496  // "rr" prefix = "receive request" in destdata
497  std::string key = "rr" + ss.str();
498 
499  return sRequest.empty() ? m_wallet->eraseDestData(dest, key)
500  : m_wallet->addDestData(dest, key, sRequest);
501 }
502 
504  return !gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET);
505 }
506 
507 QString WalletModel::getWalletName() const {
508  return QString::fromStdString(m_wallet->getWalletName());
509 }
510 
512  const QString name = getWalletName();
513  return name.isEmpty() ? "[" + tr("default wallet") + "]" : name;
514 }
515 
517  return m_node.getWallets().size() > 1;
518 }
519 
521  return Params();
522 }
void loadReceiveRequests(std::vector< std::string > &vReceiveRequests)
Model for list of recently generated payment requests / bitcoincash: URIs.
TransactionTableModel * transactionTableModel
Definition: walletmodel.h:184
std::shared_ptr< CWallet > m_wallet
Definition: wallet.cpp:464
interfaces::Wallet & wallet() const
Definition: walletmodel.h:150
static constexpr Amount zero()
Definition: amount.h:35
RecentRequestsTableModel * recentRequestsTableModel
Definition: walletmodel.h:185
std::unique_ptr< interfaces::Handler > m_handler_address_book_changed
Definition: walletmodel.h:168
static bool isWalletEnabled()
void startPollBalance()
Definition: walletmodel.cpp:50
Bilingual messages:
Definition: translation.h:17
bool IsValidDestinationString(const std::string &str, const CChainParams &params)
Definition: key_io.cpp:186
NodeContext & m_node
Definition: chain.cpp:442
UnlockContext requestUnlock()
std::unique_ptr< interfaces::Handler > m_handler_unload
Definition: walletmodel.h:166
void unsubscribeFromCoreSignals()
std::basic_string< char, std::char_traits< char >, secure_allocator< char > > SecureString
Definition: secure.h:56
Definition: amount.h:17
SendCoinsReturn sendCoins(WalletModelTransaction &transaction)
QList< SendCoinsRecipient > getRecipients() const
static constexpr Amount SATOSHI
Definition: amount.h:151
static const bool DEFAULT_DISABLE_WALLET
Definition: wallet.h:103
std::unique_ptr< interfaces::Handler > m_handler_status_changed
Definition: walletmodel.h:167
bool fSubtractFeeFromAmount
Definition: wallet.h:223
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system...
Definition: chainparams.h:47
std::string translated
Definition: translation.h:19
Double ended buffer combining vector and stream-like interfaces.
Definition: streams.h:196
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
Definition: system.cpp:498
virtual std::vector< std::unique_ptr< Wallet > > getWallets()=0
Return interfaces for accessing wallets (if any).
void setTransactionFee(const Amount newFee)
AddressTableModel * getAddressTableModel()
Coin Control Features.
Definition: coincontrol.h:19
void updateStatus()
Definition: walletmodel.cpp:57
EncryptionStatus getEncryptionStatus() const
UnlockContext(WalletModel *wallet, bool valid, bool relock)
static void NotifyCanGetAddressesChanged(WalletModel *walletmodel)
void coinsSent(interfaces::Wallet &wallet, SendCoinsRecipient recipient, QByteArray transaction)
const CChainParams & getChainParams() const
size_type size() const
Definition: streams.h:279
void updateTransaction()
New transaction, or transaction changed status.
Definition: walletmodel.cpp:96
Collection of wallet balances.
Definition: wallet.h:319
const char * name
Definition: rest.cpp:43
bool changePassphrase(const SecureString &oldPass, const SecureString &newPass)
static void NotifyAddressBookChanged(WalletModel *walletmodel, const CTxDestination &address, const std::string &label, bool isMine, const std::string &purpose, ChangeType status)
void reassignAmounts(int nChangePosRet)
std::unique_ptr< interfaces::Wallet > m_wallet
Definition: walletmodel.h:165
SendCoinsReturn prepareTransaction(WalletModelTransaction &transaction, const CCoinControl &coinControl)
void encryptionStatusChanged()
OptionsModel * optionsModel
Definition: walletmodel.h:181
CTxDestination DecodeDestination(const std::string &addr, const CChainParams &params)
Definition: key_io.cpp:177
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a Bitcoin scriptPubKey for the given CTxDestination.
Definition: standard.cpp:246
QString getWalletName() const
TransactionTableModel * getTransactionTableModel()
EncryptionStatus cachedEncryptionStatus
Definition: walletmodel.h:189
UI model for the transaction table of a wallet.
Model for Bitcoin network client.
Definition: clientmodel.h:34
Qt model of the address book in the core.
static void NotifyTransactionChanged(WalletModel *walletmodel, const TxId &hash, ChangeType status)
static const int MODEL_UPDATE_DELAY
Definition: guiconstants.h:11
bool setWalletLocked(bool locked, const SecureString &passPhrase=SecureString())
std::unique_ptr< interfaces::Handler > m_handler_show_progress
Definition: walletmodel.h:170
bool validateAddress(const QString &address)
static void NotifyKeyStoreStatusChanged(WalletModel *walletmodel)
void updateWatchOnlyFlag(bool fHaveWatchonly)
Watch-only added.
static void NotifyUnload(WalletModel *walletModel)
int cachedNumBlocks
Definition: walletmodel.h:190
void requireUnlock()
bool fForceCheckBalanceChanged
Definition: walletmodel.h:177
std::unique_ptr< interfaces::Handler > m_handler_can_get_addrs_changed
Definition: walletmodel.h:172
RecentRequestsTableModel * getRecentRequestsTableModel()
Interface from Qt to configuration data structure for Bitcoin client.
Definition: optionsmodel.h:48
const CChainParams & Params()
Return the currently selected parameters.
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:429
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:47
A TxId is the identifier of a transaction.
Definition: txid.h:14
interfaces::WalletBalances m_cached_balances
Definition: walletmodel.h:188
static const int PROTOCOL_VERSION
network protocol versioning
Definition: version.h:11
WalletModel(std::unique_ptr< interfaces::Wallet > wallet, ClientModel &client_model, const PlatformStyle *platformStyle, QObject *parent=nullptr)
Definition: walletmodel.cpp:30
bool setWalletEncrypted(bool encrypted, const SecureString &passphrase)
interfaces::Node & m_node
Definition: walletmodel.h:174
void message(const QString &title, const QString &message, unsigned int style)
ArgsManager gArgs
Definition: system.cpp:76
void CopyFrom(UnlockContext &&rhs)
void notifyWatchonlyChanged(bool fHaveWatchonly)
Data model for a walletmodel transaction.
std::string EncodeCashAddr(const CTxDestination &dst, const CChainParams &params)
Definition: cashaddrenc.cpp:91
QString getDisplayName() const
int64_t amount
Definition: amount.h:19
AddressTableModel * addressTableModel
Definition: walletmodel.h:183
static void NotifyWatchonlyChanged(WalletModel *walletmodel, bool fHaveWatchonly)
std::unique_ptr< interfaces::Handler > m_handler_transaction_changed
Definition: walletmodel.h:169
bool isMultiwallet()
bool fHaveWatchOnly
Definition: walletmodel.h:176
virtual void commitTransaction(CTransactionRef tx, WalletValueMap value_map, WalletOrderForm order_form)=0
Commit transaction.
void checkBalanceChanged(const interfaces::WalletBalances &new_balances)
Definition: walletmodel.cpp:88
ChangeType
General change type (added, updated, removed).
Definition: ui_change_type.h:9
static void ShowProgress(WalletModel *walletmodel, const std::string &title, int nProgress)
bool saveReceiveRequest(const std::string &sAddress, const int64_t nId, const std::string &sRequest)
bool balanceChanged(const WalletBalances &prev) const
Definition: wallet.h:328
void updateAddressBook(const QString &address, const QString &label, bool isMine, const QString &purpose, int status)
New, updated or removed address book entry.
bool error(const char *fmt, const Args &... args)
Definition: system.h:47
void updateEntry(const QString &address, const QString &label, bool isMine, const QString &purpose, int status)
void balanceChanged(const interfaces::WalletBalances &balances)
std::unique_ptr< interfaces::Handler > m_handler_watch_only_changed
Definition: walletmodel.h:171
boost::variant< CNoDestination, PKHash, ScriptHash > CTxDestination
A txout script template with a specific destination.
Definition: standard.h:87
void pollBalanceChanged()
Current, immature or unconfirmed balance might have changed - emit &#39;balanceChanged&#39; if so...
Definition: walletmodel.cpp:65
OptionsModel * getOptionsModel()
void subscribeToCoreSignals()