Anoncoin  0.9.4
P2P Digital Currency
Classes | Public Types | Public Slots | Signals | Public Member Functions | Private Member Functions | Private Attributes | List of all members
WalletModel Class Reference

Interface to Anoncoin wallet from Qt view code. More...

#include <walletmodel.h>

Inheritance diagram for WalletModel:
[legend]
Collaboration diagram for WalletModel:
[legend]

Classes

struct  SendCoinsReturn
 
class  UnlockContext
 

Public Types

enum  StatusCode {
  OK, InvalidAmount, InvalidAddress, AmountExceedsBalance,
  AmountWithFeeExceedsBalance, DuplicateAddress, TransactionCreationFailed, TransactionCommitFailed
}
 
enum  EncryptionStatus { Unencrypted, Locked, Unlocked }
 

Public Slots

void updateStatus ()
 
void updateTransaction (const QString &hash, int status)
 
void updateAddressBook (const QString &address, const QString &label, bool isMine, const QString &purpose, int status)
 
void updateWatchOnlyFlag (bool fHaveWatchonly)
 
void pollBalanceChanged ()
 
void setProcessingQueuedTransactions (bool value)
 

Signals

void balanceChanged (qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance, qint64 watchOnlyBalance, qint64 watchUnconfBalance, qint64 watchImmatureBalance)
 
void encryptionStatusChanged (int status)
 
void requireUnlock ()
 
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 (CWallet *wallet, OptionsModel *optionsModel, QObject *parent=0)
 
 ~WalletModel ()
 
OptionsModelgetOptionsModel ()
 
AddressTableModelgetAddressTableModel ()
 
TransactionTableModelgetTransactionTableModel ()
 
RecentRequestsTableModelgetRecentRequestsTableModel ()
 
qint64 getBalance (const CCoinControl *coinControl=NULL) const
 
qint64 getUnconfirmedBalance () const
 
qint64 getImmatureBalance () const
 
bool haveWatchOnly () const
 
qint64 getWatchBalance () const
 
qint64 getWatchUnconfirmedBalance () const
 
qint64 getWatchImmatureBalance () const
 
EncryptionStatus getEncryptionStatus () const
 
bool processingQueuedTransactions ()
 
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 changePassphrase (const SecureString &oldPass, const SecureString &newPass)
 
bool backupWallet (const QString &filename)
 
UnlockContext requestUnlock ()
 
bool getPubKey (const CKeyID &address, CPubKey &vchPubKeyOut) 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)
 

Private Member Functions

void subscribeToCoreSignals ()
 
void unsubscribeFromCoreSignals ()
 
void checkBalanceChanged ()
 

Private Attributes

CWalletwallet
 
bool fProcessingQueuedTransactions
 
bool fHaveWatchOnly
 
bool fForceCheckBalanceChanged
 
OptionsModeloptionsModel
 
AddressTableModeladdressTableModel
 
TransactionTableModeltransactionTableModel
 
RecentRequestsTableModelrecentRequestsTableModel
 
qint64 cachedBalance
 
qint64 cachedUnconfirmedBalance
 
qint64 cachedImmatureBalance
 
qint64 cachedWatchOnlyBalance
 
qint64 cachedWatchUnconfBalance
 
qint64 cachedWatchImmatureBalance
 
EncryptionStatus cachedEncryptionStatus
 
int cachedNumBlocks
 
QTimer * pollTimer
 

Detailed Description

Interface to Anoncoin wallet from Qt view code.

Definition at line 97 of file walletmodel.h.

Member Enumeration Documentation

Enumerator
Unencrypted 
Locked 
Unlocked 

Definition at line 117 of file walletmodel.h.

Enumerator
OK 
InvalidAmount 
InvalidAddress 
AmountExceedsBalance 
AmountWithFeeExceedsBalance 
DuplicateAddress 
TransactionCreationFailed 
TransactionCommitFailed 

Definition at line 105 of file walletmodel.h.

Constructor & Destructor Documentation

WalletModel::WalletModel ( CWallet wallet,
OptionsModel optionsModel,
QObject *  parent = 0 
)
explicit

Definition at line 28 of file walletmodel.cpp.

Here is the call graph for this function:

WalletModel::~WalletModel ( )

Definition at line 52 of file walletmodel.cpp.

Here is the call graph for this function:

Member Function Documentation

bool WalletModel::backupWallet ( const QString &  filename)

Definition at line 435 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void WalletModel::balanceChanged ( qint64  balance,
qint64  unconfirmedBalance,
qint64  immatureBalance,
qint64  watchOnlyBalance,
qint64  watchUnconfBalance,
qint64  watchImmatureBalance 
)
signal

Definition at line 240 of file moc_walletmodel.cpp.

Here is the caller graph for this function:

bool WalletModel::changePassphrase ( const SecureString oldPass,
const SecureString newPass 
)

Definition at line 424 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void WalletModel::checkBalanceChanged ( )
private

Definition at line 137 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void WalletModel::coinsSent ( CWallet wallet,
SendCoinsRecipient  recipient,
QByteArray  transaction 
)
signal

Definition at line 267 of file moc_walletmodel.cpp.

Here is the caller graph for this function:

void WalletModel::encryptionStatusChanged ( int  status)
signal

Definition at line 247 of file moc_walletmodel.cpp.

Here is the caller graph for this function:

AddressTableModel * WalletModel::getAddressTableModel ( )

Definition at line 365 of file walletmodel.cpp.

Here is the caller graph for this function:

qint64 WalletModel::getBalance ( const CCoinControl coinControl = NULL) const

Definition at line 57 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

WalletModel::EncryptionStatus WalletModel::getEncryptionStatus ( ) const

Definition at line 380 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

qint64 WalletModel::getImmatureBalance ( ) const

Definition at line 79 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

OptionsModel * WalletModel::getOptionsModel ( )

Definition at line 360 of file walletmodel.cpp.

Here is the caller graph for this function:

void WalletModel::getOutputs ( const std::vector< COutPoint > &  vOutpoints,
std::vector< COutput > &  vOutputs 
)

Definition at line 578 of file walletmodel.cpp.

Here is the caller graph for this function:

bool WalletModel::getPubKey ( const CKeyID address,
CPubKey vchPubKeyOut 
) const

Definition at line 572 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

RecentRequestsTableModel * WalletModel::getRecentRequestsTableModel ( )

Definition at line 375 of file walletmodel.cpp.

Here is the caller graph for this function:

TransactionTableModel * WalletModel::getTransactionTableModel ( )

Definition at line 370 of file walletmodel.cpp.

Here is the caller graph for this function:

qint64 WalletModel::getUnconfirmedBalance ( ) const

Definition at line 74 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

qint64 WalletModel::getWatchBalance ( ) const

Definition at line 89 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

qint64 WalletModel::getWatchImmatureBalance ( ) const

Definition at line 99 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

qint64 WalletModel::getWatchUnconfirmedBalance ( ) const

Definition at line 94 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool WalletModel::haveWatchOnly ( ) const

Definition at line 84 of file walletmodel.cpp.

Here is the caller graph for this function:

bool WalletModel::isLockedCoin ( uint256  hash,
unsigned int  n 
) const

Definition at line 635 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool WalletModel::isSpent ( const COutPoint outpoint) const

Definition at line 591 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void WalletModel::listCoins ( std::map< QString, std::vector< COutput > > &  mapCoins) const

Definition at line 598 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void WalletModel::listLockedCoins ( std::vector< COutPoint > &  vOutpts)

Definition at line 653 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void WalletModel::loadReceiveRequests ( std::vector< std::string > &  vReceiveRequests)

Definition at line 659 of file walletmodel.cpp.

Here is the caller graph for this function:

void WalletModel::lockCoin ( COutPoint output)

Definition at line 641 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void WalletModel::message ( const QString &  title,
const QString &  message,
unsigned int  style 
)
signal

Definition at line 260 of file moc_walletmodel.cpp.

Here is the caller graph for this function:

void WalletModel::notifyWatchonlyChanged ( bool  fHaveWatchonly)
signal

Definition at line 281 of file moc_walletmodel.cpp.

Here is the caller graph for this function:

void WalletModel::pollBalanceChanged ( )
slot

Definition at line 112 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

WalletModel::SendCoinsReturn WalletModel::prepareTransaction ( WalletModelTransaction transaction,
const CCoinControl coinControl = NULL 
)

Definition at line 194 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool WalletModel::processingQueuedTransactions ( )
inline

Definition at line 137 of file walletmodel.h.

Here is the caller graph for this function:

WalletModel::UnlockContext WalletModel::requestUnlock ( )

Definition at line 536 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void WalletModel::requireUnlock ( )
signal

Definition at line 254 of file moc_walletmodel.cpp.

Here is the caller graph for this function:

bool WalletModel::saveReceiveRequest ( const std::string &  sAddress,
const int64_t  nId,
const std::string &  sRequest 
)

Definition at line 668 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

WalletModel::SendCoinsReturn WalletModel::sendCoins ( WalletModelTransaction transaction)

Definition at line 295 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void WalletModel::setProcessingQueuedTransactions ( bool  value)
inlineslot

Definition at line 266 of file walletmodel.h.

bool WalletModel::setWalletEncrypted ( bool  encrypted,
const SecureString passphrase 
)

Definition at line 396 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool WalletModel::setWalletLocked ( bool  locked,
const SecureString passPhrase = SecureString() 
)

Definition at line 410 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void WalletModel::showProgress ( const QString &  title,
int  nProgress 
)
signal

Definition at line 274 of file moc_walletmodel.cpp.

void WalletModel::subscribeToCoreSignals ( )
private

Definition at line 515 of file walletmodel.cpp.

Here is the caller graph for this function:

void WalletModel::unlockCoin ( COutPoint output)

Definition at line 647 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void WalletModel::unsubscribeFromCoreSignals ( )
private

Definition at line 525 of file walletmodel.cpp.

Here is the caller graph for this function:

void WalletModel::updateAddressBook ( const QString &  address,
const QString &  label,
bool  isMine,
const QString &  purpose,
int  status 
)
slot

Definition at line 175 of file walletmodel.cpp.

Here is the call graph for this function:

void WalletModel::updateStatus ( )
slot

Definition at line 104 of file walletmodel.cpp.

Here is the call graph for this function:

void WalletModel::updateTransaction ( const QString &  hash,
int  status 
)
slot

Definition at line 166 of file walletmodel.cpp.

Here is the call graph for this function:

void WalletModel::updateWatchOnlyFlag ( bool  fHaveWatchonly)
slot

Definition at line 182 of file walletmodel.cpp.

bool WalletModel::validateAddress ( const QString &  address)

Definition at line 188 of file walletmodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

AddressTableModel* WalletModel::addressTableModel
private

Definition at line 209 of file walletmodel.h.

qint64 WalletModel::cachedBalance
private

Definition at line 214 of file walletmodel.h.

EncryptionStatus WalletModel::cachedEncryptionStatus
private

Definition at line 220 of file walletmodel.h.

qint64 WalletModel::cachedImmatureBalance
private

Definition at line 216 of file walletmodel.h.

int WalletModel::cachedNumBlocks
private

Definition at line 221 of file walletmodel.h.

qint64 WalletModel::cachedUnconfirmedBalance
private

Definition at line 215 of file walletmodel.h.

qint64 WalletModel::cachedWatchImmatureBalance
private

Definition at line 219 of file walletmodel.h.

qint64 WalletModel::cachedWatchOnlyBalance
private

Definition at line 217 of file walletmodel.h.

qint64 WalletModel::cachedWatchUnconfBalance
private

Definition at line 218 of file walletmodel.h.

bool WalletModel::fForceCheckBalanceChanged
private

Definition at line 203 of file walletmodel.h.

bool WalletModel::fHaveWatchOnly
private

Definition at line 202 of file walletmodel.h.

bool WalletModel::fProcessingQueuedTransactions
private

Definition at line 201 of file walletmodel.h.

OptionsModel* WalletModel::optionsModel
private

Definition at line 207 of file walletmodel.h.

QTimer* WalletModel::pollTimer
private

Definition at line 223 of file walletmodel.h.

RecentRequestsTableModel* WalletModel::recentRequestsTableModel
private

Definition at line 211 of file walletmodel.h.

TransactionTableModel* WalletModel::transactionTableModel
private

Definition at line 210 of file walletmodel.h.

CWallet* WalletModel::wallet
private

Definition at line 200 of file walletmodel.h.


The documentation for this class was generated from the following files: