PRCYCoin  2.0.0.7rc1
P2P Digital Currency
sendcoinsdialog.cpp
Go to the documentation of this file.
1 // Copyright (c) 2011-2014 The Bitcoin developers
2 // Copyright (c) 2014-2015 The Dash developers
3 // Copyright (c) 2015-2017 The DAPS Project developers
4 // Distributed under the MIT/X11 software license, see the accompanying
5 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
6 
7 #include "sendcoinsdialog.h"
8 #include "ui_sendcoinsdialog.h"
9 
10 #include "addresstablemodel.h"
11 #include "askpassphrasedialog.h"
12 #include "bitcoinunits.h"
13 #include "chainparams.h"
14 #include "clientmodel.h"
15 #include "coincontroldialog.h"
16 #include "guiutil.h"
17 #include "optionsmodel.h"
18 #include "masternode-sync.h"
19 #include "sendcoinsentry.h"
20 #include "walletmodel.h"
21 
22 #include "base58.h"
23 #include "coincontrol.h"
24 #include "guiinterface.h"
25 #include "utilmoneystr.h"
26 #include "wallet/wallet.h"
27 #include "2faconfirmdialog.h"
28 #include "timedata.h"
29 
30 #include <regex>
31 #include <QMessageBox>
32 #include <QScrollBar>
33 #include <QSettings>
34 #include <QTextDocument>
35 #include <QDateTime>
36 #include <QDebug>
37 #include <QDesktopServices>
38 #include <QUrl>
39 
40 
41 SendCoinsDialog::SendCoinsDialog(QWidget* parent) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint),
42  ui(new Ui::SendCoinsDialog),
43  clientModel(0),
44  // m_SizeGrip(this),
45  model(0),
46  fNewRecipientAllowed(true)
47 {
48  ui->setupUi(this);
49 
50  addEntry();
51 
52  connect(ui->addButton, SIGNAL(clicked()), this, SLOT(addEntry()));
53 
54  // Coin Control
55  connect(ui->pushButtonCoinControl, SIGNAL(clicked()), this, SLOT(coinControlButtonClicked()));
56  connect(ui->checkBoxCoinControlChange, SIGNAL(stateChanged(int)), this, SLOT(coinControlChangeChecked(int)));
57  connect(ui->lineEditCoinControlChange, SIGNAL(textEdited(const QString&)), this, SLOT(coinControlChangeEdited(const QString&)));
58 
59  // Coin Control: clipboard actions
60  QAction* clipboardQuantityAction = new QAction(tr("Copy quantity"), this);
61  QAction* clipboardAmountAction = new QAction(tr("Copy amount"), this);
62  QAction* clipboardFeeAction = new QAction(tr("Copy fee"), this);
63  QAction* clipboardAfterFeeAction = new QAction(tr("Copy after fee"), this);
64  QAction* clipboardBytesAction = new QAction(tr("Copy bytes"), this);
65  QAction* clipboardPriorityAction = new QAction(tr("Copy priority"), this);
66  QAction* clipboardLowOutputAction = new QAction(tr("Copy dust"), this);
67  QAction* clipboardChangeAction = new QAction(tr("Copy change"), this);
68  connect(clipboardQuantityAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardQuantity()));
69  connect(clipboardAmountAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardAmount()));
70  connect(clipboardFeeAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardFee()));
71  connect(clipboardAfterFeeAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardAfterFee()));
72  connect(clipboardBytesAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardBytes()));
73  connect(clipboardPriorityAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardPriority()));
74  connect(clipboardLowOutputAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardLowOutput()));
75  connect(clipboardChangeAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardChange()));
76  ui->labelCoinControlQuantity->addAction(clipboardQuantityAction);
77  ui->labelCoinControlAmount->addAction(clipboardAmountAction);
78  ui->labelCoinControlFee->addAction(clipboardFeeAction);
79  ui->labelCoinControlAfterFee->addAction(clipboardAfterFeeAction);
80  ui->labelCoinControlBytes->addAction(clipboardBytesAction);
81  ui->labelCoinControlPriority->addAction(clipboardPriorityAction);
82  ui->labelCoinControlLowOutput->addAction(clipboardLowOutputAction);
83  ui->labelCoinControlChange->addAction(clipboardChangeAction);
84 
85  // #HIDE multisend / unused items
86  ui->addButton->setVisible(false);
87  ui->checkBoxCoinControlChange->setVisible(false);
88  ui->lineEditCoinControlChange->setVisible(false);
89  ui->splitBlockCheckBox->setVisible(false);
90  ui->splitBlockLineEdit->setVisible(false);
91  ui->labelBlockSize->setVisible(false);
92  ui->labelBlockSizeText->setVisible(false);
93  ui->labelCoinControlInsuffFunds->setVisible(false);
94 
95  // hide coin control frame
96  ui->frameCoinControl->hide();
97 }
98 
100 {
101  this->clientModel = clientModel;
102 
103  if (clientModel) {
104  }
105 }
106 
108 {
109  this->model = model;
110 
111  if (model && model->getOptionsModel()) {
112  for (int i = 0; i < ui->entries->count(); ++i) {
113  SendCoinsEntry* entry = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(i)->widget());
114  if (entry) {
115  entry->setModel(model);
116  }
117  }
118 
119  connect(model, SIGNAL(balanceChanged(CAmount, CAmount, CAmount, CAmount, CAmount, CAmount)), this,
121  }
122 }
123 
124 void SendCoinsDialog::setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance,
125  const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance)
126 {
127  int status = model->getEncryptionStatus();
128  if (status == WalletModel::Locked || status == WalletModel::UnlockedForStakingOnly) {
129  ui->labelBalance->setText("Locked; Hidden");
130  } else if (settings.value("fHideBalance", false).toBool()) {
131  ui->labelBalance->setText("Hidden");
132  } else {
133  ui->labelBalance->setText(BitcoinUnits::formatHtmlWithUnit(0, balance, false, BitcoinUnits::separatorAlways));
134  }
135 }
136 
138  delete ui;
139 }
140 
143  QMessageBox msgBox;
144  msgBox.setWindowTitle("Send Disabled - Syncing");
145  msgBox.setText("Sending PRCY is disabled when you are still syncing the wallet. Please allow the wallet to fully sync before attempting to send a transaction.");
146  msgBox.setStyleSheet(GUIUtil::loadStyleSheet());
147  msgBox.setIcon(QMessageBox::Warning);
148  msgBox.exec();
149  return;
150  }
151  if (!ui->entries->count())
152  return;
153 
154  SendCoinsEntry* form = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(0)->widget());
155  SendCoinsRecipient recipient = form->getValue();
156  QString address = recipient.address;
157  CAmount balance = model->getBalance();
158  send_address = recipient.address;
159  send_amount = recipient.amount;
160  bool isValidAddresss = (regex_match(address.toStdString(), std::regex("[a-zA-z0-9]+")))&&(address.length()==99||address.length()==110);
161  bool isValidAmount = ((recipient.amount>0) && (recipient.amount<=balance));
162  bool fAlwaysRequest2FA = settings.value("fAlwaysRequest2FA").toBool();
163  bool fAlwaysRequestPassphrase = settings.value("fAlwaysRequestPassphrase").toBool();
164 
165  form->errorAddress(isValidAddresss);
166  form->errorAmount(isValidAmount);
167 
168  if (!isValidAddresss) {
169  QMessageBox msgBox;
170  msgBox.setWindowTitle("Invalid Address");
171  msgBox.setText("Invalid address entered. Please make sure you are sending to a Stealth Address.");
172  msgBox.setStyleSheet(GUIUtil::loadStyleSheet());
173  msgBox.setIcon(QMessageBox::Warning);
174  msgBox.exec();
175  return;
176  }
177 
178  if (!isValidAmount) {
179  QMessageBox msgBox;
180  msgBox.setWindowTitle("Invalid Amount");
181  msgBox.setText("Invalid amount entered. Please enter an amount less than your Spendable Balance.");
182  msgBox.setStyleSheet(GUIUtil::loadStyleSheet());
183  msgBox.setIcon(QMessageBox::Warning);
184  msgBox.exec();
185  return;
186  }
187 
188  // request unlock only if was locked or unlocked for mixing:
189  // this way we let users unlock by walletpassphrase or by menu
190  // and make many transactions while unlocking through this dialog
191  // will call relock
193  if (encStatus == model->Locked || encStatus == model->UnlockedForStakingOnly || fAlwaysRequestPassphrase) {
195  if (!ctx.isValid()) {
196  // Unlock wallet was cancelled
197  return;
198  }
199  }
200 
201  // Format confirmation message
202  QStringList formatted;
203  formatted.append("<center>");
204  QString amount = "<b>" + BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), recipient.amount)+"</b>";
205 
206  QString recipientElement;
207  recipientElement.append("<span class='h1 b'>"+amount+"</span><br/>");
208  recipientElement.append("<br/>to<br/>");
209  //if (rcp.label.length() > 0)
210  //recipientElement.append("<br/><span class='h3'>"+tr("Description")+": <br/><b>"+GUIUtil::HtmlEscape(rcp.label)+"</b></span>");
211  recipientElement.append("<br/><span class='h3'>"+tr("Destination")+": <br/><b>"+recipient.address+"</b></span><br/>");
212 
213  formatted.append(recipientElement);
214  SetRingSize(0);
216  QString questionString = "<br/><span class='h2'><center><b>"+tr("Are you sure you want to send?")+"</b></center></span>";
217  questionString.append("%1");
218  questionString.append("<br/><span class='h3'>"+tr("Estimated Transaction fee")+": <br/><b>");
219  questionString.append(strFee+"</b></span>");
220  questionString.append("<br/><br/>");
221 
223  CAmount totalAmount;
224  if (recipient.amount == balance) {
225  totalAmount = send_amount;
226  } else {
227  totalAmount = send_amount + txFee;
228  }
229 
230  // Show total amount + all alternative units
231  questionString.append(tr("<span class='h3'>Total Amount = <b>%1</b><br/></center>")
233 
234  if (fAlwaysRequest2FA) {
235  questionString.append("<center><br/>Note: Request 2FA authentication code before sending any transactions is enabled.<br/>You will be asked for your 2FA code on the next screen.<br/><br/></center>");
236  }
237 
238  // Display message box
239  QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm Send Coins"),
240  questionString.arg(formatted.join("<br />")),
241  QMessageBox::Yes | QMessageBox::Cancel,
242  QMessageBox::Cancel);
243 
244  if (retval != QMessageBox::Yes) {
245  return;
246  }
247 
248  bool nStaking = (nLastCoinStakeSearchInterval > 0);
249 
250  if (nStaking) {
251  CAmount spendable = pwalletMain->GetSpendableBalance();
252  if (!(recipient.amount <= nReserveBalance && recipient.amount <= spendable)) {
253  if (recipient.amount > spendable) {
254  QMessageBox msgBox;
255  msgBox.setWindowTitle("Insufficient Spendable Funds!");
256  msgBox.setText("Insufficient spendable funds. Send with smaller amount or wait for your coins become mature");
257  msgBox.setStyleSheet(GUIUtil::loadStyleSheet());
258  msgBox.setIcon(QMessageBox::Information);
259  msgBox.exec();
260  } else if (recipient.amount > nReserveBalance) {
261  QMessageBox msgBox;
262  msgBox.setWindowTitle("Insufficient Reserve Funds!");
263  msgBox.setText("Insufficient reserve funds. Send with smaller amount or turn off staking mode.");
264  msgBox.setStyleSheet(GUIUtil::loadStyleSheet());
265  msgBox.setIcon(QMessageBox::Information);
266  msgBox.exec();
267  }
268  return;
269  }
270  }
271 
272  bool status = pwalletMain->Read2FA();
273  if (!status) {
274  sendTx();
275  return;
276  }
277  uint lastTime = pwalletMain->Read2FALastTime();
278  uint period = pwalletMain->Read2FAPeriod();
279  QDateTime current = QDateTime::currentDateTime();
280  uint diffTime = current.toTime_t() - lastTime;
281  if (diffTime <= period * 24 * 60 * 60 || !fAlwaysRequest2FA)
282  sendTx();
283  else {
284  TwoFAConfirmDialog codedlg;
285  codedlg.setWindowTitle("2FA Code Verification");
286  codedlg.setStyleSheet(GUIUtil::loadStyleSheet());
287  connect(&codedlg, SIGNAL(finished (int)), this, SLOT(dialogIsFinished(int)));
288  codedlg.exec();
289  }
290 }
291 
293  CWalletTx resultTx;
294  bool success = false;
295  std::string sendAddress = send_address.toStdString();
296  CAmount spendable = model->getSpendableBalance();
297  CAmount balance = model->getBalance();
298  try {
299  if (send_amount == spendable && spendable == balance) {
300  // Send All
301  success = pwalletMain->SendAll(
302  sendAddress,
303  resultTx,
304  false
305  );
306  } else {
307  // Send
309  sendAddress,
310  send_amount,
311  resultTx,
312  false
313  );
314  }
315 
316  } catch (const std::exception& err) {
317  std::string errMes(err.what());
318  if (errMes.find("You have attempted to send more than 50 UTXOs in a single transaction") != std::string::npos) {
319  QMessageBox::StandardButton reply;
320  reply = QMessageBox::question(this, "Transaction Size Too Large", QString(err.what()) + QString("\n\nDo you want to combine small UTXOs into a larger one?"), QMessageBox::Yes|QMessageBox::No);
321  if (reply == QMessageBox::Yes) {
322  CAmount backupReserve = nReserveBalance;
323  try {
324  uint32_t nTime = GetAdjustedTime();
325  nReserveBalance = 0;
327  send_amount,
328  send_amount, nTime);
329  nReserveBalance = backupReserve;
330  if (success) {
331  QString msg = "Consolidation transaction created!";
332  QMessageBox msgBox;
333  msgBox.setWindowTitle("Information");
334  msgBox.setIcon(QMessageBox::Information);
335  msgBox.setText(msg);
336  msgBox.setStyleSheet(GUIUtil::loadStyleSheet());
337  msgBox.exec();
338  } else {
339  QMessageBox msgBox;
340  msgBox.setWindowTitle("Sweeping Transaction Creation Error");
341  msgBox.setText(QString("Sweeping transaction creation failed due to an internal error. Please try again later."));
342  msgBox.setStyleSheet(GUIUtil::loadStyleSheet());
343  msgBox.setIcon(QMessageBox::Critical);
344  msgBox.exec();
345  }
346  } catch (const std::exception& err1) {
347  nReserveBalance = backupReserve;
348  QMessageBox msgBox;
349  LogPrintf("ERROR:%s: %s\n", __func__, err1.what());
350  msgBox.setWindowTitle("Sweeping Transaction Creation Error");
351  msgBox.setText(QString("Sweeping transaction creation failed due to an internal error. Please try again later."));
352  msgBox.setStyleSheet(GUIUtil::loadStyleSheet());
353  msgBox.setIcon(QMessageBox::Critical);
354  msgBox.exec();
355  }
356  return;
357  } else {
358  return;
359  }
360  } else {
361  QString msg = err.what();
362  if (msg == "") {
363  msg = "Unable to create transaction. Please try again later.";
364  }
365  QMessageBox msgBox;
366  msgBox.setWindowTitle("Transaction Creation Error");
367  msgBox.setText(msg);
368  msgBox.setStyleSheet(GUIUtil::loadStyleSheet());
369  msgBox.setIcon(QMessageBox::Critical);
370  msgBox.exec();
371  }
372  return;
373  }
374 
375  if (success){
377  QString txhash = resultTx.GetHash().GetHex().c_str();
378 
379  std::string myAddress;
380  pwalletMain->ComputeStealthPublicAddress("masteraccount", myAddress);
381  bool showCheckBox = false;
382  int indexOut = -1;
383  if (sendAddress == myAddress) {
384  for (int i=0; i < (int)resultTx.vout.size(); i++) {
385  CTxOut& out = resultTx.vout[i];
386  CAmount value = pwalletMain->getCTxOutValue(resultTx, out);
387  if (value == Params().MNCollateralAmt()) {
388  showCheckBox = true;
389  indexOut = i;
390  }
391  }
392  }
393 
394  QMessageBox msgBox;
395  QCheckBox *cb = new QCheckBox("5000 PRCY transaction detected. Would you like to lock this transaction output?");
396  if (showCheckBox) {
397  msgBox.setCheckBox(cb);
398  }
399  QPushButton *viewButton = msgBox.addButton(tr("View on Explorer"), QMessageBox::ActionRole);
400  QPushButton *copyButton = msgBox.addButton(tr("Copy"), QMessageBox::ActionRole);
401  QPushButton *okButton = msgBox.addButton(tr("OK"), QMessageBox::ActionRole);
402  msgBox.setWindowTitle("Transaction Initialized");
403  msgBox.setText("Transaction initialized.\n\n" + txhash);
404  msgBox.setStyleSheet(GUIUtil::loadStyleSheet());
405  msgBox.setIcon(QMessageBox::Information);
406  msgBox.exec();
407 
408  if (msgBox.clickedButton() == viewButton) {
409  QString URL;
410  // Adjust link depending on Network
411  if (Params().NetworkID() == CBaseChainParams::MAIN) {
412  URL = "https://explorer.prcycoin.com/tx/";
413  } else if (Params().NetworkID() == CBaseChainParams::TESTNET){
414  URL = "https://testnet.prcycoin.com/tx/";
415  }
416  // Open the link
417  QDesktopServices::openUrl(QUrl(URL.append(txhash)));
418  }
419 
420  if (msgBox.clickedButton() == copyButton) {
421  //Copy txhash to clipboard
422  GUIUtil::setClipboard(txhash);
423  }
424  if ((msgBox.clickedButton() == viewButton || msgBox.clickedButton() == copyButton || msgBox.clickedButton() == okButton) && cb->isChecked()) {
425  // Lock collateral output
426  COutPoint collateralOut(resultTx.GetHash(), indexOut);
427  model->lockCoin(collateralOut);
428  LogPrintf("Masternode transaction: %s:%i has been locked\n", resultTx.GetHash().GetHex().c_str(), indexOut);
429  }
430  }
431 }
432 
434  if(result == QDialog::Accepted){
435  sendTx();
436  }
437 }
438 
440 {
441  SendCoinsEntry* entry = new SendCoinsEntry(this);
442  entry->setModel(model);
443  ui->entries->addWidget(entry);
444 
445  ui->scrollAreaWidgetContents->resize(ui->scrollAreaWidgetContents->sizeHint());
446  qApp->processEvents();
447  QScrollBar* bar = ui->scrollArea->verticalScrollBar();
448  if (bar)
449  bar->setSliderPosition(bar->maximum());
450  return entry;
451 }
452 // Coin Control: copy label "Quantity" to clipboard
454 {
455  GUIUtil::setClipboard(ui->labelCoinControlQuantity->text());
456 }
457 
458 // Coin Control: copy label "Amount" to clipboard
460 {
461  GUIUtil::setClipboard(ui->labelCoinControlAmount->text().left(ui->labelCoinControlAmount->text().indexOf(" ")));
462 }
463 
464 // Coin Control: copy label "Fee" to clipboard
466 {
467  GUIUtil::setClipboard(ui->labelCoinControlFee->text().left(ui->labelCoinControlFee->text().indexOf(" ")).replace("~", ""));
468 }
469 
470 // Coin Control: copy label "After fee" to clipboard
472 {
473  GUIUtil::setClipboard(ui->labelCoinControlAfterFee->text().left(ui->labelCoinControlAfterFee->text().indexOf(" ")).replace("~", ""));
474 }
475 
476 // Coin Control: copy label "Bytes" to clipboard
478 {
479  GUIUtil::setClipboard(ui->labelCoinControlBytes->text().replace("~", ""));
480 }
481 
482 // Coin Control: copy label "Priority" to clipboard
484 {
485  GUIUtil::setClipboard(ui->labelCoinControlPriority->text());
486 }
487 
488 // Coin Control: copy label "Dust" to clipboard
490 {
491  GUIUtil::setClipboard(ui->labelCoinControlLowOutput->text());
492 }
493 
494 // Coin Control: copy label "Change" to clipboard
496 {
497  GUIUtil::setClipboard(ui->labelCoinControlChange->text().left(ui->labelCoinControlChange->text().indexOf(" ")).replace("~", ""));
498 }
499 
500 // Coin Control: settings menu - coin control enabled/disabled by user
502 {
503  ui->frameCoinControl->setVisible(checked);
504 
505  if (!checked && model) // coin control features disabled
507 
508  if (checked)
510 }
511 
512 // Coin Control: button inputs -> show actual coin control dialog
514 {
515  CoinControlDialog dlg;
516  dlg.setModel(model);
517  dlg.exec();
519 }
520 
521 // Coin Control: checkbox custom change address
523 {
524  if (state == Qt::Unchecked) {
526  ui->labelCoinControlChangeLabel->clear();
527  } else
528  // use this to re-validate an already entered address
529  coinControlChangeEdited(ui->lineEditCoinControlChange->text());
530 
531  ui->lineEditCoinControlChange->setEnabled((state == Qt::Checked));
532 }
533 
534 // Coin Control: custom change address changed
536 {
537  if (model && model->getAddressTableModel()) {
538  // Default to no change address until verified
540  ui->labelCoinControlChangeLabel->setStyleSheet("QLabel{color:red;}");
541 
542  CBitcoinAddress addr = CBitcoinAddress(text.toStdString());
543 
544  if (text.isEmpty()) // Nothing entered
545  {
546  ui->labelCoinControlChangeLabel->setText("");
547  } else if (!addr.IsValid()) // Invalid address
548  {
549  ui->labelCoinControlChangeLabel->setText(tr("Warning: Invalid PIVX address"));
550  } else // Valid address
551  {
552  CPubKey pubkey;
553  CKeyID keyid;
554  addr.GetKeyID(keyid);
555  if (!model->getPubKey(keyid, pubkey)) // Unknown change address
556  {
557  ui->labelCoinControlChangeLabel->setText(tr("Warning: Unknown change address"));
558  } else // Known change address
559  {
560  ui->labelCoinControlChangeLabel->setStyleSheet("QLabel{color:black;}");
561 
562  // Query label
563  QString associatedLabel = model->getAddressTableModel()->labelForAddress(text);
564  if (!associatedLabel.isEmpty())
565  ui->labelCoinControlChangeLabel->setText(associatedLabel);
566  else
567  ui->labelCoinControlChangeLabel->setText(tr("(no label)"));
568 
570  }
571  }
572  }
573 }
574 
575 // Coin Control: update labels
577 {
579  return;
580 
581  // set pay amounts
583  for (int i = 0; i < ui->entries->count(); ++i) {
584  SendCoinsEntry* entry = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(i)->widget());
585  if (entry)
587  }
588 
589  if (CoinControlDialog::coinControl->HasSelected()) {
590  // actual coin control calculation
592 
593  // show coin control stats
594  ui->labelCoinControlAutomaticallySelected->hide();
595  ui->widgetCoinControl->show();
596  } else {
597  // hide coin control stats
598  ui->labelCoinControlAutomaticallySelected->show();
599  ui->widgetCoinControl->hide();
600  ui->labelCoinControlInsuffFunds->hide();
601  }
602 }
SendCoinsRecipient::amount
CAmount amount
Definition: walletmodel.h:61
SendCoinsDialog::SendCoinsDialog
SendCoinsDialog(QWidget *parent=0)
Definition: sendcoinsdialog.cpp:41
SendCoinsDialog::coinControlClipboardAmount
void coinControlClipboardAmount()
Definition: sendcoinsdialog.cpp:459
WalletModel::getOptionsModel
OptionsModel * getOptionsModel()
Definition: walletmodel.cpp:358
SendCoinsEntry::errorAddress
void errorAddress(bool valid)
Definition: sendcoinsentry.cpp:216
CoinControlDialog::payAmounts
static QList< CAmount > payAmounts
Definition: coincontroldialog.h:55
WalletModel::EncryptionStatus
EncryptionStatus
Definition: walletmodel.h:124
WalletModel::UnlockContext::isValid
bool isValid() const
Definition: walletmodel.h:195
CWallet::SendAll
bool SendAll(std::string des, CWalletTx &wtxNew, bool inclLocked)
Definition: wallet.cpp:5252
WalletModel
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:102
SendCoinsDialog::setBalance
void setBalance(const CAmount &balance, const CAmount &unconfirmedBalance, const CAmount &immatureBalance, const CAmount &watchOnlyBalance, const CAmount &watchUnconfBalance, const CAmount &watchImmatureBalance)
Definition: sendcoinsdialog.cpp:124
zxcvbn::regex_match
std::vector< Match > regex_match(const std::string &password, const std::vector< std::pair< RegexTag, std::regex >> &regexen)
Definition: matching.cpp:603
CBitcoinAddress::GetKeyID
bool GetKeyID(CKeyID &keyID) const
Definition: base58.cpp:281
base_uint::GetHex
std::string GetHex() const
Definition: arith_uint256.cpp:155
TwoFAConfirmDialog
Definition: 2faconfirmdialog.h:11
sendcoinsdialog.h
timedata.h
walletmodel.h
CoinControlDialog::setModel
void setModel(WalletModel *model)
Definition: coincontroldialog.cpp:164
CBitcoinAddress
base58-encoded PRCY addresses.
Definition: base58.h:109
CWallet::Read2FALastTime
uint64_t Read2FALastTime()
Definition: wallet.cpp:406
WalletModel::getAddressTableModel
AddressTableModel * getAddressTableModel()
Definition: walletmodel.cpp:363
AddressTableModel::labelForAddress
QString labelForAddress(const QString &address) const
Definition: addresstablemodel.cpp:400
CMasternodeSync::IsBlockchainSynced
bool IsBlockchainSynced()
Definition: masternode-sync.cpp:32
CoinControlDialog
Definition: coincontroldialog.h:39
wallet.h
CWallet::GetSpendableBalance
CAmount GetSpendableBalance()
Definition: wallet.cpp:2260
SendCoinsDialog::coinControlFeatureChanged
void coinControlFeatureChanged(bool)
Definition: sendcoinsdialog.cpp:501
masternode-sync.h
SendCoinsDialog::coinControlButtonClicked
void coinControlButtonClicked()
Definition: sendcoinsdialog.cpp:513
CWallet::ComputeFee
int ComputeFee(size_t numIn, size_t numOut, size_t ringSize)
Definition: wallet.cpp:3139
WalletUtil::getTx
std::map< QString, QString > getTx(CWallet *wallet, uint256 hash)
Definition: walletmodel.cpp:752
SendCoinsDialog::on_sendButton_clicked
void on_sendButton_clicked()
Definition: sendcoinsdialog.cpp:141
CKeyID
A reference to a CKey: the Hash160 of its serialized public key.
Definition: pubkey.h:29
SendCoinsDialog::addEntry
SendCoinsEntry * addEntry()
Definition: sendcoinsdialog.cpp:439
WalletModel::getPubKey
bool getPubKey(const CKeyID &address, CPubKey &vchPubKeyOut) const
Definition: walletmodel.cpp:586
CWallet::ComputeStealthPublicAddress
bool ComputeStealthPublicAddress(const std::string &accountName, std::string &pubAddress)
Definition: wallet.cpp:6379
chainparams.h
guiinterface.h
SendCoinsDialog::~SendCoinsDialog
~SendCoinsDialog()
Definition: sendcoinsdialog.cpp:137
SendCoinsDialog::send_amount
CAmount send_amount
Definition: sendcoinsdialog.h:53
SendCoinsDialog::sendTx
void sendTx()
Definition: sendcoinsdialog.cpp:292
SendCoinsDialog::coinControlClipboardPriority
void coinControlClipboardPriority()
Definition: sendcoinsdialog.cpp:483
SendCoinsDialog::clientModel
ClientModel * clientModel
Definition: sendcoinsdialog.h:48
GUIUtil::setClipboard
void setClipboard(const QString &str)
Definition: guiutil.cpp:785
OptionsModel::getDisplayUnit
int getDisplayUnit()
Definition: optionsmodel.h:60
SendCoinsDialog::coinControlClipboardAfterFee
void coinControlClipboardAfterFee()
Definition: sendcoinsdialog.cpp:471
masternodeSync
CMasternodeSync masternodeSync
Definition: masternode-sync.cpp:19
SendCoinsRecipient
Definition: walletmodel.h:46
MAX_RING_SIZE
int MAX_RING_SIZE
Definition: main.cpp:92
WalletModel::lockCoin
void lockCoin(COutPoint &output)
Definition: walletmodel.cpp:656
CTxOut
An output of a transaction.
Definition: transaction.h:164
OptionsModel::getCoinControlFeatures
bool getCoinControlFeatures()
Definition: optionsmodel.h:62
sendcoinsentry.h
nReserveBalance
int64_t nReserveBalance
Definition: wallet.cpp:59
CTransaction::vout
std::vector< CTxOut > vout
Definition: transaction.h:286
WalletModel::getCWallet
CWallet * getCWallet()
Definition: walletmodel.cpp:574
SendCoinsDialog::send_address
QString send_address
Definition: sendcoinsdialog.h:51
WalletModel::getEncryptionStatus
EncryptionStatus getEncryptionStatus() const
Definition: walletmodel.cpp:373
CBaseChainParams::MAIN
@ MAIN
Definition: chainparamsbase.h:19
SendCoinsDialog::dialogIsFinished
void dialogIsFinished(int result)
Definition: sendcoinsdialog.cpp:433
LogPrintf
#define LogPrintf(...)
Definition: logging.h:147
CAmount
int64_t CAmount
Amount in PRCY (Can be negative)
Definition: amount.h:17
SendCoinsDialog
Dialog for sending bitcoins.
Definition: sendcoinsdialog.h:32
guiutil.h
CWallet::Read2FAPeriod
int Read2FAPeriod()
Definition: wallet.cpp:397
WalletModel::getSpendableBalance
CAmount getSpendableBalance() const
Definition: walletmodel.cpp:94
WalletModel::Locked
@ Locked
Definition: walletmodel.h:126
2faconfirmdialog.h
CoinControlDialog::updateLabels
static void updateLabels(WalletModel *, QDialog *)
Definition: coincontroldialog.cpp:517
CWallet::SendToStealthAddress
bool SendToStealthAddress(const std::string &stealthAddr, CAmount nValue, CWalletTx &wtxNew, bool fUseIX=false, int ringSize=5)
Definition: wallet.cpp:6640
CBaseChainParams::TESTNET
@ TESTNET
Definition: chainparamsbase.h:20
CNoDestination
Definition: standard.h:68
SendCoinsDialog::coinControlClipboardBytes
void coinControlClipboardBytes()
Definition: sendcoinsdialog.cpp:477
SendCoinsDialog::ui
Ui::SendCoinsDialog * ui
Definition: sendcoinsdialog.h:47
SetRingSize
void SetRingSize(int nHeight)
Definition: main.cpp:2466
SendCoinsEntry::setModel
void setModel(WalletModel *model)
Definition: sendcoinsentry.cpp:93
nLastCoinStakeSearchInterval
int64_t nLastCoinStakeSearchInterval
Definition: miner.cpp:67
SendCoinsDialog::coinControlClipboardChange
void coinControlClipboardChange()
Definition: sendcoinsdialog.cpp:495
ClientModel
Model for PRCY network client.
Definition: clientmodel.h:44
CPubKey
An encapsulated public key.
Definition: pubkey.h:37
GetAdjustedTime
int64_t GetAdjustedTime()
Definition: timedata.cpp:30
Ui
Definition: 2faconfirmdialog.h:7
CWallet::CreateSweepingTransaction
bool CreateSweepingTransaction(CAmount target, CAmount threshold, uint32_t nTimeBefore)
Definition: wallet.cpp:5472
SendCoinsDialog::model
WalletModel * model
Definition: sendcoinsdialog.h:49
SendCoinsDialog::settings
QSettings settings
Definition: sendcoinsdialog.h:52
WalletModel::UnlockContext
Definition: walletmodel.h:189
CoinControlDialog::coinControl
static CCoinControl * coinControl
Definition: coincontroldialog.h:56
utilmoneystr.h
BitcoinUnits::separatorAlways
@ separatorAlways
Definition: bitcoinunits.h:69
SendCoinsDialog::setClientModel
void setClientModel(ClientModel *clientModel)
Definition: sendcoinsdialog.cpp:99
SendCoinsRecipient::address
QString address
Definition: walletmodel.h:57
CWalletTx
A transaction with a bunch of additional info that only the owner cares about.
Definition: wallet.h:792
SendCoinsDialog::coinControlClipboardLowOutput
void coinControlClipboardLowOutput()
Definition: sendcoinsdialog.cpp:489
SendCoinsDialog::setModel
void setModel(WalletModel *model)
Definition: sendcoinsdialog.cpp:107
coincontroldialog.h
SendCoinsDialog::coinControlChangeChecked
void coinControlChangeChecked(int)
Definition: sendcoinsdialog.cpp:522
Params
const CChainParams & Params()
Return the currently selected parameters.
Definition: chainparams.cpp:463
bitcoinunits.h
SendCoinsDialog::coinControlClipboardFee
void coinControlClipboardFee()
Definition: sendcoinsdialog.cpp:465
SendCoinsDialog::coinControlChangeEdited
void coinControlChangeEdited(const QString &)
Definition: sendcoinsdialog.cpp:535
SendCoinsEntry
A single entry in the dialog for sending bitcoins.
Definition: sendcoinsentry.h:25
SendCoinsDialog::coinControlUpdateLabels
void coinControlUpdateLabels()
Definition: sendcoinsdialog.cpp:576
BitcoinUnits::formatHtmlWithUnit
static QString formatHtmlWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Definition: bitcoinunits.cpp:195
base58.h
CTransaction::GetHash
const uint256 & GetHash() const
Definition: transaction.h:342
WalletModel::UnlockedForStakingOnly
@ UnlockedForStakingOnly
Definition: walletmodel.h:128
CCoinControl::SetNull
void SetNull()
Definition: coincontrol.h:36
COutPoint
An outpoint - a combination of a transaction hash and an index n into its vout.
Definition: transaction.h:36
optionsmodel.h
coincontrol.h
CBitcoinAddress::IsValid
bool IsValid() const
Definition: base58.cpp:254
GUIUtil::loadStyleSheet
QString loadStyleSheet()
Load global CSS theme.
Definition: guiutil.cpp:721
CWallet::Read2FA
bool Read2FA()
Definition: wallet.cpp:379
CBitcoinAddress::Get
CTxDestination Get() const
Definition: base58.cpp:267
pwalletMain
CWallet * pwalletMain
Definition: wallet.cpp:49
WalletModel::requestUnlock
UnlockContext requestUnlock(AskPassphraseDialog::Context context, bool relock=false)
Definition: walletmodel.cpp:546
CChainParams::MNCollateralAmt
CAmount MNCollateralAmt() const
Definition: chainparams.h:86
askpassphrasedialog.h
addresstablemodel.h
CWallet::getCTxOutValue
CAmount getCTxOutValue(const CTransaction &tx, const CTxOut &out) const
Definition: wallet.cpp:7202
WalletModel::getBalance
CAmount getBalance(const CCoinControl *coinControl=NULL) const
Definition: walletmodel.cpp:77
SendCoinsDialog::coinControlClipboardQuantity
void coinControlClipboardQuantity()
Definition: sendcoinsdialog.cpp:453
clientmodel.h
SendCoinsEntry::errorAmount
void errorAmount(bool valid)
Definition: sendcoinsentry.cpp:222
SendCoinsEntry::getValue
SendCoinsRecipient getValue()
Definition: sendcoinsentry.cpp:146
AskPassphraseDialog::Context::Send
@ Send
Change passphrase.
CCoinControl::destChange
CTxDestination destChange
Definition: coincontrol.h:18