![]() |
Dash Core
0.12.2.1
P2P Digital Currency
|
#include <walletmodel.h>
Classes | |
struct | SendCoinsReturn |
class | UnlockContext |
Public Slots | |
void | updateStatus () |
void | updateTransaction () |
void | updateAddressBook (const QString &address, const QString &label, bool isMine, const QString &purpose, int status) |
void | updateWatchOnlyFlag (bool fHaveWatchonly) |
void | pollBalanceChanged () |
Signals | |
void | balanceChanged (const CAmount &balance, const CAmount &unconfirmedBalance, const CAmount &immatureBalance, const CAmount &anonymizedBalance, const CAmount &watchOnlyBalance, const CAmount &watchUnconfBalance, const CAmount &watchImmatureBalance) |
void | encryptionStatusChanged (int status) |
void | requireUnlock (bool fForMixingOnly=false) |
void | message (const QString &title, const QString &message, unsigned int style) |
void | coinsSent (CWallet *wallet, SendCoinsRecipient recipient, QByteArray transaction) |
void | showProgress (const QString &title, int nProgress) |
void | notifyWatchonlyChanged (bool fHaveWatchonly) |
Public Member Functions | |
WalletModel (const PlatformStyle *platformStyle, CWallet *wallet, OptionsModel *optionsModel, QObject *parent=0) | |
~WalletModel () | |
OptionsModel * | getOptionsModel () |
AddressTableModel * | getAddressTableModel () |
TransactionTableModel * | getTransactionTableModel () |
RecentRequestsTableModel * | getRecentRequestsTableModel () |
CAmount | getBalance (const CCoinControl *coinControl=NULL) const |
CAmount | getUnconfirmedBalance () const |
CAmount | getImmatureBalance () const |
CAmount | getAnonymizedBalance () const |
bool | haveWatchOnly () const |
CAmount | getWatchBalance () const |
CAmount | getWatchUnconfirmedBalance () const |
CAmount | getWatchImmatureBalance () const |
EncryptionStatus | getEncryptionStatus () const |
bool | validateAddress (const QString &address) |
SendCoinsReturn | prepareTransaction (WalletModelTransaction &transaction, const CCoinControl *coinControl=NULL) |
SendCoinsReturn | sendCoins (WalletModelTransaction &transaction) |
bool | setWalletEncrypted (bool encrypted, const SecureString &passphrase) |
bool | setWalletLocked (bool locked, const SecureString &passPhrase=SecureString(), bool fMixing=false) |
bool | changePassphrase (const SecureString &oldPass, const SecureString &newPass) |
bool | backupWallet (const QString &filename) |
UnlockContext | requestUnlock (bool fForMixingOnly=false) |
bool | getPubKey (const CKeyID &address, CPubKey &vchPubKeyOut) const |
bool | havePrivKey (const CKeyID &address) const |
void | getOutputs (const std::vector< COutPoint > &vOutpoints, std::vector< COutput > &vOutputs) |
bool | isSpent (const COutPoint &outpoint) const |
void | listCoins (std::map< QString, std::vector< COutput > > &mapCoins) const |
bool | isLockedCoin (uint256 hash, unsigned int n) const |
void | lockCoin (COutPoint &output) |
void | unlockCoin (COutPoint &output) |
void | listLockedCoins (std::vector< COutPoint > &vOutpts) |
void | loadReceiveRequests (std::vector< std::string > &vReceiveRequests) |
bool | saveReceiveRequest (const std::string &sAddress, const int64_t nId, const std::string &sRequest) |
bool | transactionCanBeAbandoned (uint256 hash) const |
bool | abandonTransaction (uint256 hash) const |
bool | hdEnabled () const |
Private Member Functions | |
void | subscribeToCoreSignals () |
void | unsubscribeFromCoreSignals () |
void | checkBalanceChanged () |
Interface to Bitcoin wallet from Qt view code.
Definition at line 102 of file walletmodel.h.
Enumerator | |
---|---|
Unencrypted | |
Locked | |
UnlockedForMixingOnly | |
Unlocked |
Definition at line 124 of file walletmodel.h.
Enumerator | |
---|---|
OK | |
InvalidAmount | |
InvalidAddress | |
AmountExceedsBalance | |
AmountWithFeeExceedsBalance | |
DuplicateAddress | |
TransactionCreationFailed | |
TransactionCommitFailed | |
AbsurdFee | |
PaymentRequestExpired |
Definition at line 110 of file walletmodel.h.
|
explicit |
Definition at line 37 of file walletmodel.cpp.
WalletModel::~WalletModel | ( | ) |
Definition at line 68 of file walletmodel.cpp.
bool WalletModel::abandonTransaction | ( | uint256 | hash | ) | const |
Definition at line 757 of file walletmodel.cpp.
Referenced by TransactionView::abandonTx().
bool WalletModel::backupWallet | ( | const QString & | filename | ) |
Definition at line 506 of file walletmodel.cpp.
Referenced by WalletView::backupWallet().
|
signal |
Definition at line 242 of file moc_walletmodel.cpp.
Referenced by checkBalanceChanged().
bool WalletModel::changePassphrase | ( | const SecureString & | oldPass, |
const SecureString & | newPass | ||
) |
Definition at line 495 of file walletmodel.cpp.
Referenced by AskPassphraseDialog::accept().
|
private |
Definition at line 160 of file walletmodel.cpp.
Referenced by pollBalanceChanged(), and sendCoins().
|
signal |
Definition at line 270 of file moc_walletmodel.cpp.
Referenced by sendCoins().
|
signal |
Definition at line 249 of file moc_walletmodel.cpp.
Referenced by updateStatus().
AddressTableModel * WalletModel::getAddressTableModel | ( | ) |
Definition at line 432 of file walletmodel.cpp.
Referenced by TransactionTableModel::addressColor(), SendCoinsDialog::coinControlChangeEdited(), TransactionTableModel::data(), TransactionView::editLabel(), TransactionTableModel::lookupAddress(), SendCoinsEntry::on_addressBookButton_clicked(), SignVerifyMessageDialog::on_addressBookButton_SM_clicked(), SignVerifyMessageDialog::on_addressBookButton_VM_clicked(), ReceiveCoinsDialog::on_receiveButton_clicked(), CoinControlDialog::setModel(), WalletView::setWalletModel(), SendCoinsEntry::updateLabel(), and CoinControlDialog::updateView().
CAmount WalletModel::getAnonymizedBalance | ( | ) | const |
Definition at line 91 of file walletmodel.cpp.
Referenced by checkBalanceChanged(), SendCoinsDialog::setModel(), OverviewPage::setWalletModel(), and SendCoinsDialog::updateDisplayUnit().
CAmount WalletModel::getBalance | ( | const CCoinControl * | coinControl = NULL | ) | const |
Definition at line 73 of file walletmodel.cpp.
Referenced by checkBalanceChanged(), prepareTransaction(), SendCoinsDialog::setModel(), OverviewPage::setWalletModel(), and SendCoinsDialog::updateDisplayUnit().
WalletModel::EncryptionStatus WalletModel::getEncryptionStatus | ( | ) | const |
Definition at line 447 of file walletmodel.cpp.
Referenced by SendCoinsDialog::on_sendButton_clicked(), MasternodeList::on_startAllButton_clicked(), MasternodeList::on_startButton_clicked(), MasternodeList::on_startMissingButton_clicked(), requestUnlock(), OverviewPage::togglePrivateSend(), WalletView::unlockWallet(), WalletView::updateEncryptionStatus(), and updateStatus().
CAmount WalletModel::getImmatureBalance | ( | ) | const |
Definition at line 101 of file walletmodel.cpp.
Referenced by checkBalanceChanged(), SendCoinsDialog::setModel(), OverviewPage::setWalletModel(), and SendCoinsDialog::updateDisplayUnit().
OptionsModel * WalletModel::getOptionsModel | ( | ) |
Definition at line 427 of file walletmodel.cpp.
Referenced by TransactionView::changedAmount(), DarksendConfig::clickBasic(), DarksendConfig::clickHigh(), DarksendConfig::clickMax(), SendCoinsDialog::coinControlUpdateLabels(), TransactionView::computeSum(), TransactionTableModel::data(), RecentRequestsTableModel::data(), TransactionView::exportClicked(), TransactionTableModel::formatTxAmount(), RecentRequestsTableModel::getAmountTitle(), ReceiveCoinsDialog::on_receiveButton_clicked(), ReceiveCoinsDialog::on_recentRequestsView_doubleClicked(), SendCoinsDialog::on_sendButton_clicked(), WalletView::processNewTransaction(), SendCoinsDialog::processSendCoinsReturn(), RecentRequestsTableModel::RecentRequestsTableModel(), SendCoinsDialog::send(), SendCoinsDialog::setBalance(), SendCoinsEntry::setModel(), TransactionView::setModel(), CoinControlDialog::setModel(), SendCoinsDialog::setModel(), ReceiveCoinsDialog::setModel(), OverviewPage::SetupTransactionList(), OverviewPage::setWalletModel(), TransactionTableModel::TransactionTableModel(), TransactionTableModel::updateAmountColumnTitle(), SendCoinsEntry::updateDisplayUnit(), ReceiveCoinsDialog::updateDisplayUnit(), OverviewPage::updateDisplayUnit(), SendCoinsDialog::updateDisplayUnit(), SendCoinsDialog::updateFeeMinimizedLabel(), CoinControlDialog::updateLabels(), SendCoinsDialog::updateMinFeeLabel(), SendCoinsDialog::updateSmartFeeLabel(), and CoinControlDialog::updateView().
void WalletModel::getOutputs | ( | const std::vector< COutPoint > & | vOutpoints, |
std::vector< COutput > & | vOutputs | ||
) |
Definition at line 643 of file walletmodel.cpp.
Referenced by CoinControlDialog::updateLabels().
Definition at line 632 of file walletmodel.cpp.
Referenced by CoinControlDialog::updateLabels().
RecentRequestsTableModel * WalletModel::getRecentRequestsTableModel | ( | ) |
Definition at line 442 of file walletmodel.cpp.
Referenced by ReceiveCoinsDialog::copyColumnToClipboard(), ReceiveCoinsDialog::copyURI(), ReceiveCoinsDialog::on_receiveButton_clicked(), ReceiveCoinsDialog::on_recentRequestsView_doubleClicked(), ReceiveCoinsDialog::on_removeRequestButton_clicked(), ReceiveCoinsDialog::on_showRequestButton_clicked(), ReceiveCoinsDialog::selectedRow(), and ReceiveCoinsDialog::setModel().
TransactionTableModel * WalletModel::getTransactionTableModel | ( | ) |
Definition at line 437 of file walletmodel.cpp.
Referenced by TransactionView::abandonTx(), WalletView::processNewTransaction(), TransactionView::setModel(), OverviewPage::SetupTransactionList(), and WalletView::setWalletModel().
CAmount WalletModel::getUnconfirmedBalance | ( | ) | const |
Definition at line 96 of file walletmodel.cpp.
Referenced by checkBalanceChanged(), SendCoinsDialog::setModel(), OverviewPage::setWalletModel(), and SendCoinsDialog::updateDisplayUnit().
CAmount WalletModel::getWatchBalance | ( | ) | const |
Definition at line 111 of file walletmodel.cpp.
Referenced by checkBalanceChanged(), SendCoinsDialog::setModel(), OverviewPage::setWalletModel(), and SendCoinsDialog::updateDisplayUnit().
CAmount WalletModel::getWatchImmatureBalance | ( | ) | const |
Definition at line 121 of file walletmodel.cpp.
Referenced by checkBalanceChanged(), SendCoinsDialog::setModel(), OverviewPage::setWalletModel(), and SendCoinsDialog::updateDisplayUnit().
CAmount WalletModel::getWatchUnconfirmedBalance | ( | ) | const |
Definition at line 116 of file walletmodel.cpp.
Referenced by checkBalanceChanged(), SendCoinsDialog::setModel(), OverviewPage::setWalletModel(), and SendCoinsDialog::updateDisplayUnit().
bool WalletModel::havePrivKey | ( | const CKeyID & | address | ) | const |
Definition at line 637 of file walletmodel.cpp.
Referenced by SendCoinsDialog::coinControlChangeEdited().
bool WalletModel::haveWatchOnly | ( | ) | const |
Definition at line 106 of file walletmodel.cpp.
Referenced by checkBalanceChanged(), TransactionView::exportClicked(), TransactionView::setModel(), and OverviewPage::setWalletModel().
bool WalletModel::hdEnabled | ( | ) | const |
Definition at line 763 of file walletmodel.cpp.
Referenced by WalletView::setWalletModel().
bool WalletModel::isLockedCoin | ( | uint256 | hash, |
unsigned int | n | ||
) | const |
Definition at line 700 of file walletmodel.cpp.
Referenced by CoinControlDialog::buttonToggleLockClicked(), CoinControlDialog::showMenu(), and CoinControlDialog::updateView().
bool WalletModel::isSpent | ( | const COutPoint & | outpoint | ) | const |
Definition at line 656 of file walletmodel.cpp.
Referenced by CoinControlDialog::updateLabels().
void WalletModel::listCoins | ( | std::map< QString, std::vector< COutput > > & | mapCoins | ) | const |
Definition at line 663 of file walletmodel.cpp.
Referenced by CoinControlDialog::updateView().
void WalletModel::listLockedCoins | ( | std::vector< COutPoint > & | vOutpts | ) |
Definition at line 718 of file walletmodel.cpp.
Referenced by CoinControlDialog::updateLabelLocked().
void WalletModel::loadReceiveRequests | ( | std::vector< std::string > & | vReceiveRequests | ) |
Definition at line 724 of file walletmodel.cpp.
Referenced by RecentRequestsTableModel::RecentRequestsTableModel().
void WalletModel::lockCoin | ( | COutPoint & | output | ) |
Definition at line 706 of file walletmodel.cpp.
Referenced by CoinControlDialog::buttonToggleLockClicked(), and CoinControlDialog::lockCoin().
|
signal |
Definition at line 263 of file moc_walletmodel.cpp.
Referenced by prepareTransaction().
|
signal |
Definition at line 284 of file moc_walletmodel.cpp.
Referenced by updateWatchOnlyFlag().
|
slot |
Definition at line 134 of file walletmodel.cpp.
Referenced by WalletModel().
WalletModel::SendCoinsReturn WalletModel::prepareTransaction | ( | WalletModelTransaction & | transaction, |
const CCoinControl * | coinControl = NULL |
||
) |
Definition at line 218 of file walletmodel.cpp.
Referenced by SendCoinsDialog::send().
WalletModel::UnlockContext WalletModel::requestUnlock | ( | bool | fForMixingOnly = false | ) |
Definition at line 578 of file walletmodel.cpp.
Referenced by AddressTableModel::addRow(), SendCoinsDialog::on_sendButton_clicked(), SignVerifyMessageDialog::on_signMessageButton_SM_clicked(), MasternodeList::on_startAllButton_clicked(), MasternodeList::on_startButton_clicked(), MasternodeList::on_startMissingButton_clicked(), and OverviewPage::togglePrivateSend().
|
signal |
Definition at line 256 of file moc_walletmodel.cpp.
Referenced by requestUnlock().
bool WalletModel::saveReceiveRequest | ( | const std::string & | sAddress, |
const int64_t | nId, | ||
const std::string & | sRequest | ||
) |
Definition at line 733 of file walletmodel.cpp.
Referenced by RecentRequestsTableModel::addNewRequest(), and RecentRequestsTableModel::removeRows().
WalletModel::SendCoinsReturn WalletModel::sendCoins | ( | WalletModelTransaction & | transaction | ) |
Definition at line 353 of file walletmodel.cpp.
Referenced by SendCoinsDialog::send().
bool WalletModel::setWalletEncrypted | ( | bool | encrypted, |
const SecureString & | passphrase | ||
) |
Definition at line 467 of file walletmodel.cpp.
Referenced by AskPassphraseDialog::accept().
bool WalletModel::setWalletLocked | ( | bool | locked, |
const SecureString & | passPhrase = SecureString() , |
||
bool | fMixing = false |
||
) |
Definition at line 481 of file walletmodel.cpp.
Referenced by AskPassphraseDialog::accept(), and WalletView::lockWallet().
|
signal |
Definition at line 277 of file moc_walletmodel.cpp.
|
private |
Definition at line 557 of file walletmodel.cpp.
Referenced by WalletModel().
bool WalletModel::transactionCanBeAbandoned | ( | uint256 | hash | ) | const |
Definition at line 748 of file walletmodel.cpp.
Referenced by TransactionView::contextualMenu().
void WalletModel::unlockCoin | ( | COutPoint & | output | ) |
Definition at line 712 of file walletmodel.cpp.
Referenced by CoinControlDialog::buttonToggleLockClicked(), and CoinControlDialog::unlockCoin().
|
private |
Definition at line 567 of file walletmodel.cpp.
Referenced by ~WalletModel().
|
slot |
Definition at line 199 of file walletmodel.cpp.
|
slot |
Definition at line 126 of file walletmodel.cpp.
|
slot |
Definition at line 193 of file walletmodel.cpp.
|
slot |
Definition at line 206 of file walletmodel.cpp.
bool WalletModel::validateAddress | ( | const QString & | address | ) |
Definition at line 212 of file walletmodel.cpp.
Referenced by AddressTableModel::addRow(), prepareTransaction(), and SendCoinsEntry::validate().
|
private |
Definition at line 224 of file walletmodel.h.
Referenced by getAddressTableModel(), updateAddressBook(), and WalletModel().
|
private |
Definition at line 232 of file walletmodel.h.
Referenced by checkBalanceChanged().
|
private |
Definition at line 229 of file walletmodel.h.
Referenced by checkBalanceChanged().
|
private |
Definition at line 236 of file walletmodel.h.
Referenced by updateStatus().
|
private |
Definition at line 231 of file walletmodel.h.
Referenced by checkBalanceChanged().
|
private |
Definition at line 237 of file walletmodel.h.
Referenced by pollBalanceChanged().
|
private |
Definition at line 239 of file walletmodel.h.
Referenced by pollBalanceChanged().
|
private |
Definition at line 238 of file walletmodel.h.
Referenced by checkBalanceChanged(), and pollBalanceChanged().
|
private |
Definition at line 230 of file walletmodel.h.
Referenced by checkBalanceChanged().
|
private |
Definition at line 235 of file walletmodel.h.
Referenced by checkBalanceChanged().
|
private |
Definition at line 233 of file walletmodel.h.
Referenced by checkBalanceChanged().
|
private |
Definition at line 234 of file walletmodel.h.
Referenced by checkBalanceChanged().
|
private |
Definition at line 218 of file walletmodel.h.
Referenced by pollBalanceChanged(), updateTransaction(), and WalletModel().
|
private |
Definition at line 217 of file walletmodel.h.
Referenced by haveWatchOnly(), updateWatchOnlyFlag(), and WalletModel().
|
private |
Definition at line 222 of file walletmodel.h.
Referenced by getOptionsModel().
|
private |
Definition at line 241 of file walletmodel.h.
Referenced by WalletModel().
|
private |
Definition at line 226 of file walletmodel.h.
Referenced by getRecentRequestsTableModel(), and WalletModel().
|
private |
Definition at line 225 of file walletmodel.h.
Referenced by getTransactionTableModel(), pollBalanceChanged(), and WalletModel().
|
private |
Definition at line 216 of file walletmodel.h.