Raven Core  3.0.0
P2P Digital Currency
Classes | Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
WalletModel Class Reference

Interface to Raven 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,
  AbsurdFee, PaymentRequestExpired
}
 
enum  EncryptionStatus { Unencrypted, Locked, Unlocked }
 

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 &watchOnlyBalance, const CAmount &watchUnconfBalance, const CAmount &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 assetsSent (CWallet *wallet, SendAssetsRecipient 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 ()
 
OptionsModelgetOptionsModel ()
 
AddressTableModelgetAddressTableModel ()
 
TransactionTableModelgetTransactionTableModel ()
 
AssetTableModelgetAssetTableModel ()
 
RecentRequestsTableModelgetRecentRequestsTableModel ()
 
CAmount getBalance (const CCoinControl *coinControl=nullptr) const
 
CAmount getUnconfirmedBalance () const
 
CAmount getImmatureBalance () 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)
 
SendCoinsReturn sendCoins (WalletModelTransaction &transaction)
 
SendCoinsReturn sendAssets (CWalletTx &tx, QList< SendAssetsRecipient > &recipients, CReserveKey &reservekey)
 
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
 
bool IsSpendable (const CTxDestination &dest) const
 
bool getPrivKey (const CKeyID &address, CKey &vchPrivKeyOut) 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
 
void listAssets (std::map< QString, std::map< QString, std::vector< COutput > > > &mapCoins) const
 RVN START. More...
 
bool isLockedCoin (uint256 hash, unsigned int n) const
 RVN END. More...
 
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 transactionCanBeBumped (uint256 hash) const
 
bool bumpFee (uint256 hash)
 
bool hdEnabled () const
 
int getDefaultConfirmTarget () const
 
bool getDefaultWalletRbf () const
 
CWalletgetWallet () const
 

Static Public Member Functions

static bool isWalletEnabled ()
 

Private Member Functions

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

Private Attributes

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

Detailed Description

Interface to Raven wallet from Qt view code.

Definition at line 165 of file walletmodel.h.

Member Enumeration Documentation

◆ EncryptionStatus

Enumerator
Unencrypted 
Locked 
Unlocked 

Definition at line 187 of file walletmodel.h.

◆ StatusCode

Enumerator
OK 
InvalidAmount 
InvalidAddress 
AmountExceedsBalance 
AmountWithFeeExceedsBalance 
DuplicateAddress 
TransactionCreationFailed 
TransactionCommitFailed 
AbsurdFee 
PaymentRequestExpired 

Definition at line 173 of file walletmodel.h.

Constructor & Destructor Documentation

◆ WalletModel()

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

Definition at line 42 of file walletmodel.cpp.

Here is the call graph for this function:

◆ ~WalletModel()

WalletModel::~WalletModel ( )

Definition at line 67 of file walletmodel.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ abandonTransaction()

bool WalletModel::abandonTransaction ( uint256  hash) const

Definition at line 743 of file walletmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ assetsSent

void WalletModel::assetsSent ( CWallet wallet,
SendAssetsRecipient  recipient,
QByteArray  transaction 
)
signal

◆ backupWallet()

bool WalletModel::backupWallet ( const QString &  filename)

Definition at line 511 of file walletmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ balanceChanged

void WalletModel::balanceChanged ( const CAmount balance,
const CAmount unconfirmedBalance,
const CAmount immatureBalance,
const CAmount watchOnlyBalance,
const CAmount watchUnconfBalance,
const CAmount watchImmatureBalance 
)
signal
Here is the caller graph for this function:

◆ bumpFee()

bool WalletModel::bumpFee ( uint256  hash)

Definition at line 758 of file walletmodel.cpp.

Here is the caller graph for this function:

◆ changePassphrase()

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

Definition at line 500 of file walletmodel.cpp.

Here is the call graph for this function:

◆ checkBalanceChanged()

void WalletModel::checkBalanceChanged ( )
private

Definition at line 147 of file walletmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ coinsSent

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

◆ encryptionStatusChanged

void WalletModel::encryptionStatusChanged ( int  status)
signal
Here is the caller graph for this function:

◆ getAddressTableModel()

AddressTableModel * WalletModel::getAddressTableModel ( )

Definition at line 436 of file walletmodel.cpp.

Here is the caller graph for this function:

◆ getAssetTableModel()

AssetTableModel * WalletModel::getAssetTableModel ( )

Definition at line 446 of file walletmodel.cpp.

Here is the caller graph for this function:

◆ getBalance()

CAmount WalletModel::getBalance ( const CCoinControl coinControl = nullptr) const

Definition at line 72 of file walletmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDefaultConfirmTarget()

int WalletModel::getDefaultConfirmTarget ( ) const

Definition at line 842 of file walletmodel.cpp.

◆ getDefaultWalletRbf()

bool WalletModel::getDefaultWalletRbf ( ) const

Definition at line 847 of file walletmodel.cpp.

◆ getEncryptionStatus()

WalletModel::EncryptionStatus WalletModel::getEncryptionStatus ( ) const

Definition at line 456 of file walletmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getImmatureBalance()

CAmount WalletModel::getImmatureBalance ( ) const

Definition at line 87 of file walletmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOptionsModel()

OptionsModel * WalletModel::getOptionsModel ( )

Definition at line 431 of file walletmodel.cpp.

◆ getOutputs()

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

Definition at line 635 of file walletmodel.cpp.

Here is the caller graph for this function:

◆ getPrivKey()

bool WalletModel::getPrivKey ( const CKeyID address,
CKey vchPrivKeyOut 
) const

Definition at line 629 of file walletmodel.cpp.

Here is the call graph for this function:

◆ getPubKey()

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

Definition at line 619 of file walletmodel.cpp.

Here is the call graph for this function:

◆ getRecentRequestsTableModel()

RecentRequestsTableModel * WalletModel::getRecentRequestsTableModel ( )

Definition at line 451 of file walletmodel.cpp.

Here is the caller graph for this function:

◆ getTransactionTableModel()

TransactionTableModel * WalletModel::getTransactionTableModel ( )

Definition at line 441 of file walletmodel.cpp.

Here is the caller graph for this function:

◆ getUnconfirmedBalance()

CAmount WalletModel::getUnconfirmedBalance ( ) const

Definition at line 82 of file walletmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getWallet()

CWallet * WalletModel::getWallet ( ) const

Definition at line 852 of file walletmodel.cpp.

Here is the caller graph for this function:

◆ getWatchBalance()

CAmount WalletModel::getWatchBalance ( ) const

Definition at line 97 of file walletmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getWatchImmatureBalance()

CAmount WalletModel::getWatchImmatureBalance ( ) const

Definition at line 107 of file walletmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getWatchUnconfirmedBalance()

CAmount WalletModel::getWatchUnconfirmedBalance ( ) const

Definition at line 102 of file walletmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ haveWatchOnly()

bool WalletModel::haveWatchOnly ( ) const

Definition at line 92 of file walletmodel.cpp.

Here is the caller graph for this function:

◆ hdEnabled()

bool WalletModel::hdEnabled ( ) const

Definition at line 837 of file walletmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isLockedCoin()

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

RVN END.

Definition at line 694 of file walletmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsSpendable()

bool WalletModel::IsSpendable ( const CTxDestination dest) const

Definition at line 624 of file walletmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isSpent()

bool WalletModel::isSpent ( const COutPoint outpoint) const

Definition at line 649 of file walletmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isWalletEnabled()

bool WalletModel::isWalletEnabled ( )
static

Definition at line 832 of file walletmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listAssets()

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

RVN START.

Definition at line 668 of file walletmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listCoins()

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

Definition at line 656 of file walletmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listLockedCoins()

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

Definition at line 712 of file walletmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadReceiveRequests()

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

Definition at line 718 of file walletmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lockCoin()

void WalletModel::lockCoin ( COutPoint output)

Definition at line 700 of file walletmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ message

void WalletModel::message ( const QString &  title,
const QString &  message,
unsigned int  style 
)
signal
Here is the caller graph for this function:

◆ notifyWatchonlyChanged

void WalletModel::notifyWatchonlyChanged ( bool  fHaveWatchonly)
signal
Here is the caller graph for this function:

◆ pollBalanceChanged

void WalletModel::pollBalanceChanged ( )
slot

Definition at line 120 of file walletmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ prepareTransaction()

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

Definition at line 200 of file walletmodel.cpp.

Here is the call graph for this function:

◆ requestUnlock()

WalletModel::UnlockContext WalletModel::requestUnlock ( )

Definition at line 583 of file walletmodel.cpp.

Here is the call graph for this function:

◆ requireUnlock

void WalletModel::requireUnlock ( )
signal
Here is the caller graph for this function:

◆ saveReceiveRequest()

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

Definition at line 723 of file walletmodel.cpp.

Here is the call graph for this function:

◆ sendAssets()

WalletModel::SendCoinsReturn WalletModel::sendAssets ( CWalletTx tx,
QList< SendAssetsRecipient > &  recipients,
CReserveKey reservekey 
)

Definition at line 381 of file walletmodel.cpp.

Here is the call graph for this function:

◆ sendCoins()

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

Definition at line 311 of file walletmodel.cpp.

Here is the call graph for this function:

◆ setWalletEncrypted()

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

Definition at line 472 of file walletmodel.cpp.

Here is the call graph for this function:

◆ setWalletLocked()

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

Definition at line 486 of file walletmodel.cpp.

Here is the call graph for this function:

◆ showProgress

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

◆ subscribeToCoreSignals()

void WalletModel::subscribeToCoreSignals ( )
private

Definition at line 562 of file walletmodel.cpp.

◆ transactionCanBeAbandoned()

bool WalletModel::transactionCanBeAbandoned ( uint256  hash) const

Definition at line 738 of file walletmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ transactionCanBeBumped()

bool WalletModel::transactionCanBeBumped ( uint256  hash) const

Definition at line 749 of file walletmodel.cpp.

◆ unlockCoin()

void WalletModel::unlockCoin ( COutPoint output)

Definition at line 706 of file walletmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unsubscribeFromCoreSignals()

void WalletModel::unsubscribeFromCoreSignals ( )
private

Definition at line 572 of file walletmodel.cpp.

Here is the caller graph for this function:

◆ updateAddressBook

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

Definition at line 182 of file walletmodel.cpp.

Here is the call graph for this function:

◆ updateStatus

void WalletModel::updateStatus ( )
slot

Definition at line 112 of file walletmodel.cpp.

Here is the call graph for this function:

◆ updateTransaction

void WalletModel::updateTransaction ( )
slot

Definition at line 176 of file walletmodel.cpp.

◆ updateWatchOnlyFlag

void WalletModel::updateWatchOnlyFlag ( bool  fHaveWatchonly)
slot

Definition at line 189 of file walletmodel.cpp.

◆ validateAddress()

bool WalletModel::validateAddress ( const QString &  address)

Definition at line 195 of file walletmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ addressTableModel

AddressTableModel* WalletModel::addressTableModel
private

Definition at line 305 of file walletmodel.h.

◆ assetTableModel

AssetTableModel* WalletModel::assetTableModel
private

Definition at line 307 of file walletmodel.h.

◆ cachedBalance

CAmount WalletModel::cachedBalance
private

Definition at line 311 of file walletmodel.h.

◆ cachedEncryptionStatus

EncryptionStatus WalletModel::cachedEncryptionStatus
private

Definition at line 317 of file walletmodel.h.

◆ cachedImmatureBalance

CAmount WalletModel::cachedImmatureBalance
private

Definition at line 313 of file walletmodel.h.

◆ cachedNumBlocks

int WalletModel::cachedNumBlocks
private

Definition at line 318 of file walletmodel.h.

◆ cachedUnconfirmedBalance

CAmount WalletModel::cachedUnconfirmedBalance
private

Definition at line 312 of file walletmodel.h.

◆ cachedWatchImmatureBalance

CAmount WalletModel::cachedWatchImmatureBalance
private

Definition at line 316 of file walletmodel.h.

◆ cachedWatchOnlyBalance

CAmount WalletModel::cachedWatchOnlyBalance
private

Definition at line 314 of file walletmodel.h.

◆ cachedWatchUnconfBalance

CAmount WalletModel::cachedWatchUnconfBalance
private

Definition at line 315 of file walletmodel.h.

◆ fForceCheckBalanceChanged

bool WalletModel::fForceCheckBalanceChanged
private

Definition at line 299 of file walletmodel.h.

◆ fHaveWatchOnly

bool WalletModel::fHaveWatchOnly
private

Definition at line 298 of file walletmodel.h.

◆ optionsModel

OptionsModel* WalletModel::optionsModel
private

Definition at line 303 of file walletmodel.h.

◆ pollTimer

QTimer* WalletModel::pollTimer
private

Definition at line 320 of file walletmodel.h.

◆ recentRequestsTableModel

RecentRequestsTableModel* WalletModel::recentRequestsTableModel
private

Definition at line 308 of file walletmodel.h.

◆ transactionTableModel

TransactionTableModel* WalletModel::transactionTableModel
private

Definition at line 306 of file walletmodel.h.

◆ wallet

CWallet* WalletModel::wallet
private

Definition at line 297 of file walletmodel.h.


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