PRCYCoin  2.0.0.7rc1
P2P Digital Currency
walletmodel.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2014 The Bitcoin developers
2 // Distributed under the MIT/X11 software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_QT_WALLETMODEL_H
6 #define BITCOIN_QT_WALLETMODEL_H
7 
8 #if defined(HAVE_CONFIG_H)
10 #endif
11 
12 #include "askpassphrasedialog.h"
13 #include "walletmodeltransaction.h"
14 
15 #include "allocators.h" /* for SecureString */
16 #include "guiutil.h"
17 #include "key.h"
18 #include "swifttx.h"
19 #include "wallet/wallet.h"
20 #include "init.h"
21 
22 #include <map>
23 #include <vector>
24 
25 #include <QAbstractTableModel>
26 #include <QObject>
27 #include <QTimer>
28 
29 class AddressTableModel;
30 class OptionsModel;
33 
34 class CCoinControl;
35 class CKeyID;
36 class COutPoint;
37 class COutput;
38 class CPubKey;
39 class CWallet;
40 class uint256;
41 
42 QT_BEGIN_NAMESPACE
43 class QTimer;
44 QT_END_NAMESPACE
45 
47 {
48 public:
50  explicit SendCoinsRecipient(const QString& addr, const QString& label, const CAmount& amount, const QString& message) : address(addr), label(label), amount(amount), message(message), nVersion(SendCoinsRecipient::CURRENT_VERSION) {}
51 
52  // If from an insecure payment request, this is used for storing
53  // the addresses, e.g. address-A<br />address-B<br />address-C.
54  // Info: As we don't need to process addresses in here when using
55  // payment requests, we can abuse it for displaying an address list.
56  // Todo: This is a hack, should be replaced with a cleaner solution!
57  QString address;
58  QString label;
60  bool useSwiftTX;
62  // If from a payment request, this is used for storing the memo
63  QString message;
64 
65  // serialized string to ensure load/store is lossless
66  std::string sPaymentRequest{};
67  // Empty if no authentication or invalid signature/cert/etc.
69 
70  static const int CURRENT_VERSION = 1;
71  int nVersion;
72 
74 
75  template <typename Stream, typename Operation>
76  inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion)
77  {
78  std::string sAddress = address.toStdString();
79  std::string sLabel = label.toStdString();
80  std::string sMessage = message.toStdString();
81  std::string sAuthenticatedMerchant = authenticatedMerchant.toStdString();
82 
83  READWRITE(this->nVersion);
84  nVersion = this->nVersion;
85  READWRITE(sAddress);
86  READWRITE(sLabel);
88  READWRITE(sMessage);
90  READWRITE(sAuthenticatedMerchant);
91 
92  if (ser_action.ForRead()) {
93  address = QString::fromStdString(sAddress);
94  label = QString::fromStdString(sLabel);
95  message = QString::fromStdString(sMessage);
96  authenticatedMerchant = QString::fromStdString(sAuthenticatedMerchant);
97  }
98  }
99 };
100 
102 class WalletModel : public QObject
103 {
104  Q_OBJECT
105 
106 public:
107  explicit WalletModel(CWallet* wallet, OptionsModel* optionsModel, QObject* parent = 0);
108  ~WalletModel();
109 
110  enum StatusCode // Returned by sendCoins
111  {
112  OK,
118  TransactionCreationFailed, // Error returned when wallet is still locked
122  };
123 
125  Unencrypted, // !wallet->IsCrypted()
126  Locked, // wallet->IsCrypted() && wallet->IsLocked()
127  Unlocked, // wallet->IsCrypted() && !wallet->IsLocked()
128  UnlockedForStakingOnly // wallet->IsCrypted() && !wallet->IsLocked() && wallet->fWalletUnlockStakingOnly
129  };
130 
134  QAbstractTableModel* getTxTableModel();
135 
136  bool isShutdownRequested();
137 
139 
140  CAmount getBalance(const CCoinControl* coinControl = NULL) const;
142  CAmount getImmatureBalance() const;
143  CAmount getLockedBalance() const;
145  bool haveWatchOnly() const;
146  CAmount getWatchBalance() const;
150  CKey generateNewKey() const; //for temporary paper wallet key generation
151  bool setAddressBook(const CTxDestination& address, const std::string& strName, const std::string& strPurpose);
152  void encryptKey(const CKey key, const std::string& pwd, const std::string& slt, std::vector<unsigned char>& crypted);
153  void decryptKey(const std::vector<unsigned char>& crypted, const std::string& slt, const std::string& pwd, CKey& key);
154  void emitBalanceChanged(); // Force update of UI-elements even when no values have changed
156  void generateCoins(bool fGenerate, int nGenProcLimit);
157 
158  // Check address for validity
159  bool validateAddress(const QString& address);
160 
161  // Return status record for SendCoins, contains error id + information
165  };
166 
167  // prepare transaction for getting txfee before sending coins
168  SendCoinsReturn prepareTransaction(WalletModelTransaction& transaction, const CCoinControl* coinControl = NULL);
169 
170  // Send coins to a list of recipients
172 
173  // Wallet encryption
174  bool setWalletEncrypted(bool encrypted, const SecureString& passphrase);
175  // Passphrase only needed when unlocking
176  bool setWalletLocked(bool locked, const SecureString& passPhrase = SecureString(), bool stakingOnly = false);
177 
178  // Method used to "lock" the wallet only for staking purposes. Just a flag that should prevent possible movements in the wallet.
179  // Passphrase only needed when unlocking.
180  bool lockForStakingOnly(const SecureString& passPhrase = SecureString());
181 
182  bool changePassphrase(const SecureString& oldPass, const SecureString& newPass);
183  // Is wallet unlocked for staking only?
184  bool isStakingOnlyUnlocked();
185  // Wallet backup
186  bool backupWallet(const QString& filename);
187 
188  // RAI object for unlocking wallet, returned by requestUnlock()
190  {
191  public:
192  UnlockContext(bool valid, bool relock);
193  ~UnlockContext();
194 
195  bool isValid() const { return valid; }
196 
197  // Copy operator and constructor transfer the context
198  UnlockContext(const UnlockContext& obj) { CopyFrom(obj); }
200  {
201  CopyFrom(rhs);
202  return *this;
203  }
204 
205  private:
206  bool valid;
207  mutable bool relock; // mutable, as it can be set to false by copying
208 
209  void CopyFrom(const UnlockContext& rhs);
210  };
211 
212  UnlockContext requestUnlock(AskPassphraseDialog::Context context, bool relock = false);
213 
214  CWallet* getCWallet();
215 
216  bool getPubKey(const CKeyID& address, CPubKey& vchPubKeyOut) const;
217  bool isMine(CBitcoinAddress address);
218  bool getSeedPhrase(std::string &phrase) const;
219  void getOutputs(const std::vector<COutPoint>& vOutpoints, std::vector<COutput>& vOutputs);
220  bool isSpent(const COutPoint& outpoint) const;
221  void listCoins(std::map<QString, std::vector<COutput> >& mapCoins) const;
222 
223  bool isLockedCoin(uint256 hash, unsigned int n) const;
224  void lockCoin(COutPoint& output);
225  void unlockCoin(COutPoint& output);
226  void listLockedCoins(std::vector<COutPoint>& vOutpts);
227 
228  std::string GetUniqueWalletBackupName();
229  void loadReceiveRequests(std::vector<std::string>& vReceiveRequests);
230  bool saveReceiveRequest(const std::string& sAddress, const int64_t nId, const std::string& sRequest);
231 
232 private:
236 
237  // Wallet has an options model for wallet-specific options
238  // (transaction fee, for example)
240 
243  QAbstractTableModel* txTableModel;
244 
245  // Cache some values to be able to detect changes
256  QTimer* pollTimer;
257 
258  void subscribeToCoreSignals();
260  bool checkBalanceChanged();
261 
262 Q_SIGNALS:
263  // Signal that balance in wallet changed
264  void balanceChanged(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance, const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance);
265  void stakingStatusChanged(bool isStaking);
266  // Encryption status of wallet changed
267  void encryptionStatusChanged(int status);
268 
269  // Signal emitted when wallet needs to be unlocked
270  // It is valid behaviour for listeners to keep the wallet locked after this signal;
271  // this means that the unlocking failed or was cancelled.
273 
274  // Fired when a message should be reported to the user
275  void message(const QString& title, const QString& message, unsigned int style);
276 
277  // Coins sent: from wallet, to recipient, in (serialized) transaction:
278  void coinsSent(CWallet* wallet, SendCoinsRecipient recipient, QByteArray transaction);
279 
280  // Show progress dialog e.g. for rescan
281  void showProgress(const QString& title, int nProgress);
282 
283  // Watch-only address added
284  void notifyWatchonlyChanged(bool fHaveWatchonly);
285 
286  void RefreshRecent();
287  void WalletUnlocked();
288 
289 public Q_SLOTS:
290  /* Wallet status might have changed */
291  void updateStatus();
292  /* New transaction, or transaction changed status */
293  void updateTransaction();
294  /* New, updated or removed address book entry */
295  void updateAddressBook(const QString& address, const QString& label, bool isMine, const QString& purpose, int status);
296  void updateAddressBook(const QString& pubCoin, const QString& isUsed, int status);
297  /* Watch-only added */
298  void updateWatchOnlyFlag(bool fHaveWatchonly);
299  /* Current, immature or unconfirmed balance might have changed - Q_EMIT 'balanceChanged' if so */
300  void pollBalanceChanged();
301 };
302 
303 namespace WalletUtil
304 {
305 // get transaction string maps with keys ["date","address", "amount", "id", "type"]
306 std::vector<std::map<QString, QString> > getTXs(CWallet* wallet);
307 std::map<QString, QString> getTx(CWallet* wallet, uint256 hash);
308 std::map<QString, QString> getTx(CWallet* wallet, CWalletTx tx);
309 //
310 QList<QString> getAddressBookData(CWallet* wallet); //return a list of address strings as "description | address"
311 } // namespace WalletUtil
312 
313 #endif // BITCOIN_QT_WALLETMODEL_H
WalletModel::changePassphrase
bool changePassphrase(const SecureString &oldPass, const SecureString &newPass)
Definition: walletmodel.cpp:425
SendCoinsRecipient::amount
CAmount amount
Definition: walletmodel.h:61
WalletModel::updateStatus
void updateStatus()
Definition: walletmodel.cpp:129
WalletModel::getOptionsModel
OptionsModel * getOptionsModel()
Definition: walletmodel.cpp:358
WalletModel::isMine
bool isMine(CBitcoinAddress address)
Definition: walletmodel.cpp:698
WalletUtil::getTXs
std::vector< std::map< QString, QString > > getTXs(CWallet *wallet)
Definition: walletmodel.cpp:757
WalletModel::stakingStatusChanged
void stakingStatusChanged(bool isStaking)
WalletModel::cachedWatchOnlyBalance
CAmount cachedWatchOnlyBalance
Definition: walletmodel.h:250
WalletModel::listLockedCoins
void listLockedCoins(std::vector< COutPoint > &vOutpts)
Definition: walletmodel.cpp:668
WalletModel::TransactionCommitFailed
@ TransactionCommitFailed
Definition: walletmodel.h:119
WalletModel::EncryptionStatus
EncryptionStatus
Definition: walletmodel.h:124
WalletModel::UnlockContext::isValid
bool isValid() const
Definition: walletmodel.h:195
WalletModel::transactionTableModel
TransactionTableModel * transactionTableModel
Definition: walletmodel.h:242
WalletModel
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:102
AvailableCoinsType
AvailableCoinsType
Definition: wallet.h:109
WalletModel::InsaneFee
@ InsaneFee
Definition: walletmodel.h:121
WalletModel::TransactionCreationFailed
@ TransactionCreationFailed
Definition: walletmodel.h:118
WalletModel::StakingOnlyUnlocked
@ StakingOnlyUnlocked
Definition: walletmodel.h:120
AskPassphraseDialog::Context
Context
Definition: askpassphrasedialog.h:34
WalletModel::getStakingStatusError
StakingStatusError getStakingStatusError(QString &)
Definition: walletmodel.cpp:703
CBitcoinAddress
base58-encoded PRCY addresses.
Definition: base58.h:109
AddressTableModel
Qt model of the address book in the core.
Definition: addresstablemodel.h:19
WalletModel::backupWallet
bool backupWallet(const QString &filename)
Definition: walletmodel.cpp:436
WalletModel::getAddressTableModel
AddressTableModel * getAddressTableModel()
Definition: walletmodel.cpp:363
WalletModel::DuplicateAddress
@ DuplicateAddress
Definition: walletmodel.h:117
SendCoinsRecipient::label
QString label
Definition: walletmodel.h:58
CCoinControl
Coin Control Features.
Definition: coincontrol.h:15
WalletModel::sendCoins
SendCoinsReturn sendCoins(WalletModelTransaction &transaction)
Definition: walletmodel.cpp:344
WalletModel::AmountWithFeeExceedsBalance
@ AmountWithFeeExceedsBalance
Definition: walletmodel.h:116
WalletModel::Unlocked
@ Unlocked
Definition: walletmodel.h:127
wallet.h
WalletModel::setAddressBook
bool setAddressBook(const CTxDestination &address, const std::string &strName, const std::string &strPurpose)
WalletModel::cachedWatchUnconfBalance
CAmount cachedWatchUnconfBalance
Definition: walletmodel.h:251
WalletModel::spendableBalance
CAmount spendableBalance
Definition: walletmodel.h:248
SendCoinsRecipient::SendCoinsRecipient
SendCoinsRecipient()
Definition: walletmodel.h:49
WalletModel::isShutdownRequested
bool isShutdownRequested()
Definition: walletmodel.cpp:62
WalletModel::UnlockContext::UnlockContext
UnlockContext(const UnlockContext &obj)
Definition: walletmodel.h:198
WalletModel::requireUnlock
void requireUnlock(AskPassphraseDialog::Context context)
WalletModel::checkBalanceChanged
bool checkBalanceChanged()
Definition: walletmodel.cpp:193
SendCoinsRecipient::authenticatedMerchant
QString authenticatedMerchant
Definition: walletmodel.h:68
WalletModel::cachedBalance
CAmount cachedBalance
Definition: walletmodel.h:246
WalletModel::getTransactionTableModel
TransactionTableModel * getTransactionTableModel()
Definition: walletmodel.cpp:368
WalletModel::~WalletModel
~WalletModel()
Definition: walletmodel.cpp:67
WalletUtil::getTx
std::map< QString, QString > getTx(CWallet *wallet, uint256 hash)
Definition: walletmodel.cpp:752
CKeyID
A reference to a CKey: the Hash160 of its serialized public key.
Definition: pubkey.h:29
WalletModel::getPubKey
bool getPubKey(const CKeyID &address, CPubKey &vchPubKeyOut) const
Definition: walletmodel.cpp:586
WalletModel::SendCoinsReturn::SendCoinsReturn
SendCoinsReturn(StatusCode status=OK)
Definition: walletmodel.h:163
WalletModel::cachedUnconfirmedBalance
CAmount cachedUnconfirmedBalance
Definition: walletmodel.h:247
WalletModel::cachedImmatureBalance
CAmount cachedImmatureBalance
Definition: walletmodel.h:249
WalletModel::txTableModel
QAbstractTableModel * txTableModel
Definition: walletmodel.h:243
WalletModel::decryptKey
void decryptKey(const std::vector< unsigned char > &crypted, const std::string &slt, const std::string &pwd, CKey &key)
WalletModel::cachedNumBlocks
int cachedNumBlocks
Definition: walletmodel.h:254
WalletModel::addressTableModel
AddressTableModel * addressTableModel
Definition: walletmodel.h:241
SendCoinsRecipient::ADD_SERIALIZE_METHODS
ADD_SERIALIZE_METHODS
Definition: walletmodel.h:73
WalletModel::cachedWatchImmatureBalance
CAmount cachedWatchImmatureBalance
Definition: walletmodel.h:252
SendCoinsRecipient
Definition: walletmodel.h:46
OptionsModel
Interface from Qt to configuration data structure for Bitcoin client.
Definition: optionsmodel.h:18
StakingStatusError
StakingStatusError
Definition: wallet.h:223
WalletModel::emitBalanceChanged
void emitBalanceChanged()
Definition: walletmodel.cpp:183
WalletModel::getLockedBalance
CAmount getLockedBalance() const
Definition: walletmodel.cpp:104
WalletModel::showProgress
void showProgress(const QString &title, int nProgress)
WalletModel::AmountExceedsBalance
@ AmountExceedsBalance
Definition: walletmodel.h:115
WalletModel::lockCoin
void lockCoin(COutPoint &output)
Definition: walletmodel.cpp:656
SendCoinsRecipient::CURRENT_VERSION
static const int CURRENT_VERSION
Definition: walletmodel.h:70
WalletModel::unsubscribeFromCoreSignals
void unsubscribeFromCoreSignals()
Definition: walletmodel.cpp:534
prcycoin-config.h
WalletModel::validateAddress
bool validateAddress(const QString &address)
Definition: walletmodel.cpp:262
WalletModel::updateWatchOnlyFlag
void updateWatchOnlyFlag(bool fHaveWatchonly)
Definition: walletmodel.cpp:256
WalletModel::saveReceiveRequest
bool saveReceiveRequest(const std::string &sAddress, const int64_t nId, const std::string &sRequest)
Definition: walletmodel.cpp:683
WalletModel::generateNewKey
CKey generateNewKey() const
init.h
WalletModel::SendCoinsReturn::status
StatusCode status
Definition: walletmodel.h:164
WalletModel::message
void message(const QString &title, const QString &message, unsigned int style)
WalletModel::lockForStakingOnly
bool lockForStakingOnly(const SecureString &passPhrase=SecureString())
Definition: walletmodel.cpp:409
WalletModel::getCWallet
CWallet * getCWallet()
Definition: walletmodel.cpp:574
WalletUtil::getAddressBookData
QList< QString > getAddressBookData(CWallet *wallet)
Definition: walletmodel.cpp:881
SecureString
std::basic_string< char, std::char_traits< char >, secure_allocator< char > > SecureString
Definition: allocators.h:262
WalletModel::isLockedCoin
bool isLockedCoin(uint256 hash, unsigned int n) const
Definition: walletmodel.cpp:650
WalletModel::generateCoins
void generateCoins(bool fGenerate, int nGenProcLimit)
Definition: walletmodel.cpp:732
WalletModel::getEncryptionStatus
EncryptionStatus getEncryptionStatus() const
Definition: walletmodel.cpp:373
WalletModel::StatusCode
StatusCode
Definition: walletmodel.h:110
WalletModel::getWatchImmatureBalance
CAmount getWatchImmatureBalance() const
Definition: walletmodel.cpp:124
WalletModel::Unencrypted
@ Unencrypted
Definition: walletmodel.h:125
allocators.h
CAmount
int64_t CAmount
Amount in PRCY (Can be negative)
Definition: amount.h:17
WalletModel::loadReceiveRequests
void loadReceiveRequests(std::vector< std::string > &vReceiveRequests)
Definition: walletmodel.cpp:674
WalletModel::UnlockContext::operator=
UnlockContext & operator=(const UnlockContext &rhs)
Definition: walletmodel.h:199
guiutil.h
WalletModel::UnlockContext::valid
bool valid
Definition: walletmodel.h:206
WalletModel::cachedTxLocks
int cachedTxLocks
Definition: walletmodel.h:255
WalletModel::getSpendableBalance
CAmount getSpendableBalance() const
Definition: walletmodel.cpp:94
uint256
256-bit unsigned big integer.
Definition: uint256.h:38
SendCoinsRecipient::SendCoinsRecipient
SendCoinsRecipient(const QString &addr, const QString &label, const CAmount &amount, const QString &message)
Definition: walletmodel.h:50
WalletModel::getSeedPhrase
bool getSeedPhrase(std::string &phrase) const
Definition: walletmodel.cpp:591
WalletModel::Locked
@ Locked
Definition: walletmodel.h:126
WalletUtil
Definition: walletmodel.cpp:750
WalletModel::isSpent
bool isSpent(const COutPoint &outpoint) const
Definition: walletmodel.cpp:609
CTxDestination
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
A txout script template with a specific destination.
Definition: standard.h:81
SendCoinsRecipient::SerializationOp
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
Definition: walletmodel.h:76
key.h
TransactionTableModel
UI model for the transaction table of a wallet.
Definition: transactiontablemodel.h:21
CPubKey
An encapsulated public key.
Definition: pubkey.h:37
WalletModel::OK
@ OK
Definition: walletmodel.h:112
WalletModel::listCoins
void listCoins(std::map< QString, std::vector< COutput > > &mapCoins) const
Definition: walletmodel.cpp:616
WalletModel::setWalletEncrypted
bool setWalletEncrypted(bool encrypted, const SecureString &passphrase)
Definition: walletmodel.cpp:386
READWRITE
#define READWRITE(obj)
Definition: serialize.h:164
WalletModel::unlockCoin
void unlockCoin(COutPoint &output)
Definition: walletmodel.cpp:662
WalletModel::optionsModel
OptionsModel * optionsModel
Definition: walletmodel.h:239
WalletModel::updateTransaction
void updateTransaction()
Definition: walletmodel.cpp:238
WalletModel::getOutputs
void getOutputs(const std::vector< COutPoint > &vOutpoints, std::vector< COutput > &vOutputs)
Definition: walletmodel.cpp:597
CKey
An encapsulated private key.
Definition: key.h:39
WalletModel::UnlockContext
Definition: walletmodel.h:189
WalletModel::getMinStakingAmount
CAmount getMinStakingAmount() const
Definition: walletmodel.cpp:72
WalletModel::InvalidAmount
@ InvalidAmount
Definition: walletmodel.h:113
SendCoinsRecipient::inputType
AvailableCoinsType inputType
Definition: walletmodel.h:59
swifttx.h
SendCoinsRecipient::sPaymentRequest
std::string sPaymentRequest
Definition: walletmodel.h:66
SendCoinsRecipient::address
QString address
Definition: walletmodel.h:57
key
CKey key
Definition: bip38tooldialog.cpp:173
walletmodeltransaction.h
CWallet
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances,...
Definition: wallet.h:243
WalletModel::InvalidAddress
@ InvalidAddress
Definition: walletmodel.h:114
WalletModel::fForceCheckBalanceChanged
bool fForceCheckBalanceChanged
Definition: walletmodel.h:235
WalletModel::fHaveWatchOnly
bool fHaveWatchOnly
Definition: walletmodel.h:234
CWalletTx
A transaction with a bunch of additional info that only the owner cares about.
Definition: wallet.h:792
WalletModel::prepareTransaction
SendCoinsReturn prepareTransaction(WalletModelTransaction &transaction, const CCoinControl *coinControl=NULL)
Definition: walletmodel.cpp:269
WalletModel::SendCoinsReturn
Definition: walletmodel.h:162
WalletModel::updateAddressBook
void updateAddressBook(const QString &address, const QString &label, bool isMine, const QString &purpose, int status)
Definition: walletmodel.cpp:244
WalletModel::setWalletLocked
bool setWalletLocked(bool locked, const SecureString &passPhrase=SecureString(), bool stakingOnly=false)
Definition: walletmodel.cpp:397
SendCoinsRecipient::useSwiftTX
bool useSwiftTX
Definition: walletmodel.h:60
WalletModel::getWatchBalance
CAmount getWatchBalance() const
Definition: walletmodel.cpp:114
WalletModel::subscribeToCoreSignals
void subscribeToCoreSignals()
Definition: walletmodel.cpp:523
WalletModel::UnlockedForStakingOnly
@ UnlockedForStakingOnly
Definition: walletmodel.h:128
COutPoint
An outpoint - a combination of a transaction hash and an index n into its vout.
Definition: transaction.h:36
WalletModel::getWatchUnconfirmedBalance
CAmount getWatchUnconfirmedBalance() const
Definition: walletmodel.cpp:119
WalletModel::RefreshRecent
void RefreshRecent()
WalletModel::haveWatchOnly
bool haveWatchOnly() const
Definition: walletmodel.cpp:109
WalletModel::WalletUnlocked
void WalletUnlocked()
WalletModel::isStakingOnlyUnlocked
bool isStakingOnlyUnlocked()
Definition: walletmodel.cpp:420
WalletModel::UnlockContext::UnlockContext
UnlockContext(bool valid, bool relock)
Definition: walletmodel.cpp:566
WalletModel::encryptKey
void encryptKey(const CKey key, const std::string &pwd, const std::string &slt, std::vector< unsigned char > &crypted)
WalletModel::balanceChanged
void balanceChanged(const CAmount &balance, const CAmount &unconfirmedBalance, const CAmount &immatureBalance, const CAmount &watchOnlyBalance, const CAmount &watchUnconfBalance, const CAmount &watchImmatureBalance)
WalletModel::pollTimer
QTimer * pollTimer
Definition: walletmodel.h:256
WalletModel::UnlockContext::CopyFrom
void CopyFrom(const UnlockContext &rhs)
Definition: walletmodel.cpp:579
WalletModel::getTxTableModel
QAbstractTableModel * getTxTableModel()
Definition: walletmodel.cpp:742
WalletModel::getUnconfirmedBalance
CAmount getUnconfirmedBalance() const
Definition: walletmodel.cpp:89
WalletModel::pollBalanceChanged
void pollBalanceChanged()
Definition: walletmodel.cpp:141
COutput
Definition: wallet.h:922
WalletModel::getImmatureBalance
CAmount getImmatureBalance() const
Definition: walletmodel.cpp:99
WalletModel::requestUnlock
UnlockContext requestUnlock(AskPassphraseDialog::Context context, bool relock=false)
Definition: walletmodel.cpp:546
WalletModel::WalletModel
WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *parent=0)
Definition: walletmodel.cpp:39
askpassphrasedialog.h
WalletModel::GetUniqueWalletBackupName
std::string GetUniqueWalletBackupName()
WalletModelTransaction
Data model for a walletmodel transaction.
Definition: walletmodeltransaction.h:22
WalletModel::notifyWatchonlyChanged
void notifyWatchonlyChanged(bool fHaveWatchonly)
WalletModel::cachedEncryptionStatus
EncryptionStatus cachedEncryptionStatus
Definition: walletmodel.h:253
WalletModel::coinsSent
void coinsSent(CWallet *wallet, SendCoinsRecipient recipient, QByteArray transaction)
WalletModel::wallet
CWallet * wallet
Definition: walletmodel.h:233
WalletModel::getBalance
CAmount getBalance(const CCoinControl *coinControl=NULL) const
Definition: walletmodel.cpp:77
SendCoinsRecipient::nVersion
int nVersion
Definition: walletmodel.h:71
WalletModel::UnlockContext::~UnlockContext
~UnlockContext()
Definition: walletmodel.cpp:570
WalletModel::encryptionStatusChanged
void encryptionStatusChanged(int status)
WalletModel::UnlockContext::relock
bool relock
Definition: walletmodel.h:207
SendCoinsRecipient::message
QString message
Definition: walletmodel.h:63