Dash Core  0.12.2.1
P2P Digital Currency
Actions

Classes

struct  CompareByPriority
 
struct  CompareByAmount
 

Functions

static void ApproximateBestSubset (vector< pair< CAmount, pair< const CWalletTx *, unsigned int > > >vValue, const CAmount &nTotalLower, const CAmount &nTargetValue, vector< char > &vfBest, CAmount &nBest, int iterations=1000, bool fUseInstantSend=false)
 
bool less_then_denom (const COutput &out1, const COutput &out2)
 
static int64_t GetOldestKeyInPool (const std::set< int64_t > &setKeyPool, CWalletDB &walletdb)
 
static void LoadReserveKeysToSet (std::set< CKeyID > &setAddress, const std::set< int64_t > &setKeyPool, CWalletDB &walletdb)
 
CAmount CWallet::GetBalance () const
 
CAmount CWallet::GetAnonymizableBalance (bool fSkipDenominated=false, bool fSkipUnconfirmed=true) const
 
CAmount CWallet::GetAnonymizedBalance () const
 
float CWallet::GetAverageAnonymizedRounds () const
 
CAmount CWallet::GetNormalizedAnonymizedBalance () const
 
CAmount CWallet::GetNeedsToBeAnonymizedBalance (CAmount nMinBalance=0) const
 
CAmount CWallet::GetDenominatedBalance (bool unconfirmed=false) const
 
CAmount CWallet::GetUnconfirmedBalance () const
 
CAmount CWallet::GetImmatureBalance () const
 
CAmount CWallet::GetWatchOnlyBalance () const
 
CAmount CWallet::GetUnconfirmedWatchOnlyBalance () const
 
CAmount CWallet::GetImmatureWatchOnlyBalance () const
 
void CWallet::AvailableCoins (std::vector< COutput > &vCoins, bool fOnlyConfirmed=true, const CCoinControl *coinControl=NULL, bool fIncludeZeroValue=false, AvailableCoinsType nCoinType=ALL_COINS, bool fUseInstantSend=false) const
 
bool CWallet::SelectCoinsMinConf (const CAmount &nTargetValue, int nConfMine, int nConfTheirs, std::vector< COutput > vCoins, std::set< std::pair< const CWalletTx *, unsigned int > > &setCoinsRet, CAmount &nValueRet, bool fUseInstantSend=false) const
 
bool CWallet::SelectCoins (const CAmount &nTargetValue, std::set< std::pair< const CWalletTx *, unsigned int > > &setCoinsRet, CAmount &nValueRet, const CCoinControl *coinControl=NULL, AvailableCoinsType nCoinType=ALL_COINS, bool fUseInstantSend=true) const
 
bool CWallet::FundTransaction (CMutableTransaction &tx, CAmount &nFeeRet, int &nChangePosRet, std::string &strFailReason, bool includeWatching)
 
bool CWallet::SelectCoinsByDenominations (int nDenom, CAmount nValueMin, CAmount nValueMax, std::vector< CTxIn > &vecTxInRet, std::vector< COutput > &vCoinsRet, CAmount &nValueRet, int nPrivateSendRoundsMin, int nPrivateSendRoundsMax)
 
bool CWallet::SelectCoinsGrouppedByAddresses (std::vector< CompactTallyItem > &vecTallyRet, bool fSkipDenominated=true, bool fAnonymizable=true, bool fSkipUnconfirmed=true) const
 
bool CWallet::SelectCoinsDark (CAmount nValueMin, CAmount nValueMax, std::vector< CTxIn > &vecTxInRet, CAmount &nValueRet, int nPrivateSendRoundsMin, int nPrivateSendRoundsMax) const
 
bool CWallet::GetCollateralTxIn (CTxIn &txinRet, CAmount &nValueRet) const
 
bool CWallet::GetMasternodeOutpointAndKeys (COutPoint &outpointRet, CPubKey &pubKeyRet, CKey &keyRet, std::string strTxHash="", std::string strOutputIndex="")
 Get 1000DASH output and keys which can be used for the Masternode. More...
 
bool CWallet::GetOutpointAndKeysFromOutput (const COutput &out, COutPoint &outpointRet, CPubKey &pubKeyRet, CKey &keyRet)
 Extract txin information and keys from output. More...
 
int CWallet::CountInputsWithAmount (CAmount nInputAmount)
 
bool CWallet::HasCollateralInputs (bool fOnlyConfirmed=true) const
 
bool CWallet::IsCollateralAmount (CAmount nInputAmount) const
 
bool CWallet::CreateCollateralTransaction (CMutableTransaction &txCollateral, std::string &strReason)
 
bool CWallet::GetBudgetSystemCollateralTX (CTransaction &tx, uint256 hash, CAmount amount, bool fUseInstantSend)
 
bool CWallet::GetBudgetSystemCollateralTX (CWalletTx &tx, uint256 hash, CAmount amount, bool fUseInstantSend)
 
bool CWallet::ConvertList (std::vector< CTxIn > vecTxIn, std::vector< CAmount > &vecAmounts)
 
bool CWallet::CreateTransaction (const std::vector< CRecipient > &vecSend, CWalletTx &wtxNew, CReserveKey &reservekey, CAmount &nFeeRet, int &nChangePosRet, std::string &strFailReason, const CCoinControl *coinControl=NULL, bool sign=true, AvailableCoinsType nCoinType=ALL_COINS, bool fUseInstantSend=false)
 
bool CWallet::CommitTransaction (CWalletTx &wtxNew, CReserveKey &reservekey, CConnman *connman, std::string strCommand="tx")
 
bool CWallet::AddAccountingEntry (const CAccountingEntry &, CWalletDB &pwalletdb)
 
static CAmount CWallet::GetRequiredFee (unsigned int nTxBytes)
 
static CAmount CWallet::GetMinimumFee (unsigned int nTxBytes, unsigned int nConfirmTarget, const CTxMemPool &pool)
 
DBErrors CWallet::LoadWallet (bool &fFirstRunRet)
 
DBErrors CWallet::ZapWalletTx (std::vector< CWalletTx > &vWtx)
 
bool CWallet::SetAddressBook (const CTxDestination &address, const std::string &strName, const std::string &purpose)
 
bool CWallet::DelAddressBook (const CTxDestination &address)
 
bool CWallet::SetDefaultKey (const CPubKey &vchPubKey)
 
bool CWallet::NewKeyPool ()
 
size_t CWallet::KeypoolCountExternalKeys ()
 
size_t CWallet::KeypoolCountInternalKeys ()
 
bool CWallet::TopUpKeyPool (unsigned int kpSize=0)
 
void CWallet::ReserveKeyFromKeyPool (int64_t &nIndex, CKeyPool &keypool, bool fInternal)
 
void CWallet::KeepKey (int64_t nIndex)
 
void CWallet::ReturnKey (int64_t nIndex, bool fInternal)
 
bool CWallet::GetKeyFromPool (CPubKey &key, bool fInternal)
 
int64_t CWallet::GetOldestKeyPoolTime ()
 
std::map< CTxDestination, CAmountCWallet::GetAddressBalances ()
 
std::set< std::set< CTxDestination > > CWallet::GetAddressGroupings ()
 
std::set< CTxDestinationCWallet::GetAccountAddresses (const std::string &strAccount) const
 
bool CReserveKey::GetReservedKey (CPubKey &pubkey, bool fInternalIn)
 
void CReserveKey::KeepKey ()
 
void CReserveKey::ReturnKey ()
 
void CWallet::GetAllReserveKeys (std::set< CKeyID > &setAddress) const
 
bool CWallet::UpdatedTransaction (const uint256 &hashTx)
 
void CWallet::GetScriptForMining (boost::shared_ptr< CReserveScript > &script)
 
void CWallet::LockCoin (COutPoint &output)
 
void CWallet::UnlockCoin (COutPoint &output)
 
void CWallet::UnlockAllCoins ()
 
bool CWallet::IsLockedCoin (uint256 hash, unsigned int n) const
 
void CWallet::ListLockedCoins (std::vector< COutPoint > &vOutpts)
 

Detailed Description

Function Documentation

◆ AddAccountingEntry()

bool CWallet::AddAccountingEntry ( const CAccountingEntry acentry,
CWalletDB pwalletdb 
)

Definition at line 3579 of file wallet.cpp.

Referenced by movecmd().

◆ ApproximateBestSubset()

static void ApproximateBestSubset ( vector< pair< CAmount, pair< const CWalletTx *, unsigned int > > >  vValue,
const CAmount nTotalLower,
const CAmount nTargetValue,
vector< char > &  vfBest,
CAmount nBest,
int  iterations = 1000,
bool  fUseInstantSend = false 
)
static

Definition at line 2423 of file wallet.cpp.

Referenced by CWallet::SelectCoinsMinConf().

◆ AvailableCoins()

void CWallet::AvailableCoins ( std::vector< COutput > &  vCoins,
bool  fOnlyConfirmed = true,
const CCoinControl coinControl = NULL,
bool  fIncludeZeroValue = false,
AvailableCoinsType  nCoinType = ALL_COINS,
bool  fUseInstantSend = false 
) const

populate vCoins with vector of available COutputs.

Definition at line 2360 of file wallet.cpp.

Referenced by listunspent(), and masternode().

◆ CommitTransaction()

bool CWallet::CommitTransaction ( CWalletTx wtxNew,
CReserveKey reservekey,
CConnman connman,
std::string  strCommand = "tx" 
)

Call after CreateTransaction unless you want to abort

Definition at line 3527 of file wallet.cpp.

Referenced by CPrivateSendClient::CreateDenominated(), gobject(), CPrivateSendClient::MakeCollateralAmounts(), sendmany(), and SendMoney().

◆ ConvertList()

bool CWallet::ConvertList ( std::vector< CTxIn vecTxIn,
std::vector< CAmount > &  vecAmounts 
)

Definition at line 3158 of file wallet.cpp.

Referenced by CPrivateSendClient::StartNewQueue().

◆ CountInputsWithAmount()

int CWallet::CountInputsWithAmount ( CAmount  nInputAmount)

Definition at line 3044 of file wallet.cpp.

Referenced by CPrivateSendClient::CreateDenominated().

◆ CreateCollateralTransaction()

bool CWallet::CreateCollateralTransaction ( CMutableTransaction txCollateral,
std::string &  strReason 
)

Definition at line 3088 of file wallet.cpp.

Referenced by CPrivateSendClient::DoAutomaticDenominating().

◆ CreateTransaction()

bool CWallet::CreateTransaction ( const std::vector< CRecipient > &  vecSend,
CWalletTx wtxNew,
CReserveKey reservekey,
CAmount nFeeRet,
int &  nChangePosRet,
std::string &  strFailReason,
const CCoinControl coinControl = NULL,
bool  sign = true,
AvailableCoinsType  nCoinType = ALL_COINS,
bool  fUseInstantSend = false 
)

Create a new transaction paying the recipients with a set of coins selected by SelectCoins(); Also create the change output, when needed

Definition at line 3173 of file wallet.cpp.

Referenced by CPrivateSendClient::CreateDenominated(), CPrivateSendClient::MakeCollateralAmounts(), sendmany(), and SendMoney().

◆ DelAddressBook()

bool CWallet::DelAddressBook ( const CTxDestination address)

Definition at line 3703 of file wallet.cpp.

◆ FundTransaction()

bool CWallet::FundTransaction ( CMutableTransaction tx,
CAmount nFeeRet,
int &  nChangePosRet,
std::string &  strFailReason,
bool  includeWatching 
)

Insert additional inputs into the transaction by calling CreateTransaction();

Definition at line 2727 of file wallet.cpp.

Referenced by fundrawtransaction().

◆ GetAccountAddresses()

std::set< CTxDestination > CWallet::GetAccountAddresses ( const std::string &  strAccount) const

Definition at line 4087 of file wallet.cpp.

Referenced by getreceivedbyaccount().

◆ GetAddressBalances()

std::map< CTxDestination, CAmount > CWallet::GetAddressBalances ( )

Definition at line 3954 of file wallet.cpp.

Referenced by listaddressgroupings().

◆ GetAddressGroupings()

set< set< CTxDestination > > CWallet::GetAddressGroupings ( )

Definition at line 3994 of file wallet.cpp.

Referenced by listaddressgroupings().

◆ GetAllReserveKeys()

void CWallet::GetAllReserveKeys ( std::set< CKeyID > &  setAddress) const

Definition at line 4151 of file wallet.cpp.

Referenced by dumpwallet().

◆ GetAnonymizableBalance()

CAmount CWallet::GetAnonymizableBalance ( bool  fSkipDenominated = false,
bool  fSkipUnconfirmed = true 
) const

◆ GetAnonymizedBalance()

CAmount CWallet::GetAnonymizedBalance ( ) const

Definition at line 2177 of file wallet.cpp.

Referenced by getinfo().

◆ GetAverageAnonymizedRounds()

float CWallet::GetAverageAnonymizedRounds ( ) const

Definition at line 2202 of file wallet.cpp.

Referenced by OverviewPage::updatePrivateSendProgress().

◆ GetBalance()

CAmount CWallet::GetBalance ( ) const

◆ GetBudgetSystemCollateralTX() [1/2]

bool CWallet::GetBudgetSystemCollateralTX ( CTransaction tx,
uint256  hash,
CAmount  amount,
bool  fUseInstantSend 
)

Definition at line 3123 of file wallet.cpp.

Referenced by gobject().

◆ GetBudgetSystemCollateralTX() [2/2]

bool CWallet::GetBudgetSystemCollateralTX ( CWalletTx tx,
uint256  hash,
CAmount  amount,
bool  fUseInstantSend 
)

Definition at line 3133 of file wallet.cpp.

◆ GetCollateralTxIn()

bool CWallet::GetCollateralTxIn ( CTxIn txinRet,
CAmount nValueRet 
) const

Definition at line 2967 of file wallet.cpp.

◆ GetDenominatedBalance()

CAmount CWallet::GetDenominatedBalance ( bool  unconfirmed = false) const

◆ GetImmatureBalance()

CAmount CWallet::GetImmatureBalance ( ) const

Definition at line 2301 of file wallet.cpp.

Referenced by getwalletinfo().

◆ GetImmatureWatchOnlyBalance()

CAmount CWallet::GetImmatureWatchOnlyBalance ( ) const

Definition at line 2346 of file wallet.cpp.

◆ GetKeyFromPool()

bool CWallet::GetKeyFromPool ( CPubKey key,
bool  fInternal 
)

Definition at line 3903 of file wallet.cpp.

Referenced by AppInit2(), GetAccountAddress(), and getnewaddress().

◆ GetMasternodeOutpointAndKeys()

bool CWallet::GetMasternodeOutpointAndKeys ( COutPoint outpointRet,
CPubKey pubKeyRet,
CKey keyRet,
std::string  strTxHash = "",
std::string  strOutputIndex = "" 
)

Get 1000DASH output and keys which can be used for the Masternode.

Definition at line 2987 of file wallet.cpp.

Referenced by CMasternodeBroadcast::Create(), CActiveMasternode::ManageStateInitial(), CActiveMasternode::ManageStateLocal(), and masternode().

◆ GetMinimumFee()

CAmount CWallet::GetMinimumFee ( unsigned int  nTxBytes,
unsigned int  nConfirmTarget,
const CTxMemPool pool 
)
static

Estimate the minimum fee considering user set parameters and the required fee

Definition at line 3596 of file wallet.cpp.

Referenced by CoinControlDialog::updateLabels().

◆ GetNeedsToBeAnonymizedBalance()

CAmount CWallet::GetNeedsToBeAnonymizedBalance ( CAmount  nMinBalance = 0) const

Definition at line 2244 of file wallet.cpp.

Referenced by CPrivateSendClient::DoAutomaticDenominating().

◆ GetNormalizedAnonymizedBalance()

CAmount CWallet::GetNormalizedAnonymizedBalance ( ) const

Definition at line 2224 of file wallet.cpp.

Referenced by OverviewPage::updatePrivateSendProgress().

◆ GetOldestKeyInPool()

static int64_t GetOldestKeyInPool ( const std::set< int64_t > &  setKeyPool,
CWalletDB walletdb 
)
static

Definition at line 3923 of file wallet.cpp.

Referenced by CWallet::GetOldestKeyPoolTime().

◆ GetOldestKeyPoolTime()

int64_t CWallet::GetOldestKeyPoolTime ( )

Definition at line 3933 of file wallet.cpp.

Referenced by getinfo(), and getwalletinfo().

◆ GetOutpointAndKeysFromOutput()

bool CWallet::GetOutpointAndKeysFromOutput ( const COutput out,
COutPoint outpointRet,
CPubKey pubKeyRet,
CKey keyRet 
)

Extract txin information and keys from output.

Definition at line 3015 of file wallet.cpp.

◆ GetRequiredFee()

CAmount CWallet::GetRequiredFee ( unsigned int  nTxBytes)
static

Return the minimum required fee taking into account the floating relay fee and user set minimum transaction fee

Definition at line 3591 of file wallet.cpp.

Referenced by SendCoinsDialog::setMinimumFee(), SendCoinsDialog::setModel(), CoinControlDialog::updateLabels(), SendCoinsDialog::updateMinFeeLabel(), and SendCoinsDialog::updateSmartFeeLabel().

◆ GetReservedKey()

bool CReserveKey::GetReservedKey ( CPubKey pubkey,
bool  fInternalIn 
)

◆ GetScriptForMining()

void CWallet::GetScriptForMining ( boost::shared_ptr< CReserveScript > &  script)
virtual

Reimplemented from CValidationInterface.

Definition at line 4182 of file wallet.cpp.

◆ GetUnconfirmedBalance()

CAmount CWallet::GetUnconfirmedBalance ( ) const

Definition at line 2286 of file wallet.cpp.

Referenced by getunconfirmedbalance(), and getwalletinfo().

◆ GetUnconfirmedWatchOnlyBalance()

CAmount CWallet::GetUnconfirmedWatchOnlyBalance ( ) const

Definition at line 2331 of file wallet.cpp.

◆ GetWatchOnlyBalance()

CAmount CWallet::GetWatchOnlyBalance ( ) const

Definition at line 2315 of file wallet.cpp.

◆ HasCollateralInputs()

bool CWallet::HasCollateralInputs ( bool  fOnlyConfirmed = true) const

◆ IsCollateralAmount()

bool CWallet::IsCollateralAmount ( CAmount  nInputAmount) const

Definition at line 3080 of file wallet.cpp.

◆ IsLockedCoin()

bool CWallet::IsLockedCoin ( uint256  hash,
unsigned int  n 
) const

Definition at line 4221 of file wallet.cpp.

◆ KeepKey() [1/2]

void CWallet::KeepKey ( int64_t  nIndex)

Definition at line 3877 of file wallet.cpp.

◆ KeepKey() [2/2]

◆ KeypoolCountExternalKeys()

size_t CWallet::KeypoolCountExternalKeys ( )

Definition at line 3767 of file wallet.cpp.

Referenced by AppInit2(), getwalletinfo(), and CWalletDB::LoadWallet().

◆ KeypoolCountInternalKeys()

size_t CWallet::KeypoolCountInternalKeys ( )

Definition at line 3773 of file wallet.cpp.

Referenced by AppInit2(), and getwalletinfo().

◆ less_then_denom()

bool less_then_denom ( const COutput out1,
const COutput out2 
)

Definition at line 2483 of file wallet.cpp.

Referenced by CWallet::SelectCoinsMinConf().

◆ ListLockedCoins()

void CWallet::ListLockedCoins ( std::vector< COutPoint > &  vOutpts)

Definition at line 4229 of file wallet.cpp.

Referenced by listlockunspent().

◆ LoadReserveKeysToSet()

static void LoadReserveKeysToSet ( std::set< CKeyID > &  setAddress,
const std::set< int64_t > &  setKeyPool,
CWalletDB walletdb 
)
static

Definition at line 4138 of file wallet.cpp.

Referenced by CWallet::GetAllReserveKeys().

◆ LoadWallet()

DBErrors CWallet::LoadWallet ( bool &  fFirstRunRet)

Definition at line 3616 of file wallet.cpp.

Referenced by AppInit2().

◆ LockCoin()

void CWallet::LockCoin ( COutPoint output)

◆ NewKeyPool()

bool CWallet::NewKeyPool ( )

Mark old keypool keys as used, and generate all new keys

Definition at line 3743 of file wallet.cpp.

◆ ReserveKeyFromKeyPool()

void CWallet::ReserveKeyFromKeyPool ( int64_t &  nIndex,
CKeyPool keypool,
bool  fInternal 
)

Definition at line 3841 of file wallet.cpp.

◆ ReturnKey() [1/2]

void CWallet::ReturnKey ( int64_t  nIndex,
bool  fInternal 
)

Definition at line 3889 of file wallet.cpp.

◆ ReturnKey() [2/2]

◆ SelectCoins()

bool CWallet::SelectCoins ( const CAmount nTargetValue,
std::set< std::pair< const CWalletTx *, unsigned int > > &  setCoinsRet,
CAmount nValueRet,
const CCoinControl coinControl = NULL,
AvailableCoinsType  nCoinType = ALL_COINS,
bool  fUseInstantSend = true 
) const
private

Select a set of coins such that nValueRet >= nTargetValue and at least all coins from coinControl are selected; Never select unconfirmed coins if they are not ours

Definition at line 2623 of file wallet.cpp.

◆ SelectCoinsByDenominations()

bool CWallet::SelectCoinsByDenominations ( int  nDenom,
CAmount  nValueMin,
CAmount  nValueMax,
std::vector< CTxIn > &  vecTxInRet,
std::vector< COutput > &  vCoinsRet,
CAmount nValueRet,
int  nPrivateSendRoundsMin,
int  nPrivateSendRoundsMax 
)

◆ SelectCoinsDark()

bool CWallet::SelectCoinsDark ( CAmount  nValueMin,
CAmount  nValueMax,
std::vector< CTxIn > &  vecTxInRet,
CAmount nValueRet,
int  nPrivateSendRoundsMin,
int  nPrivateSendRoundsMax 
) const

Definition at line 2930 of file wallet.cpp.

Referenced by CPrivateSendClient::StartNewQueue().

◆ SelectCoinsGrouppedByAddresses()

bool CWallet::SelectCoinsGrouppedByAddresses ( std::vector< CompactTallyItem > &  vecTallyRet,
bool  fSkipDenominated = true,
bool  fAnonymizable = true,
bool  fSkipUnconfirmed = true 
) const

◆ SelectCoinsMinConf()

bool CWallet::SelectCoinsMinConf ( const CAmount nTargetValue,
int  nConfMine,
int  nConfTheirs,
std::vector< COutput vCoins,
std::set< std::pair< const CWalletTx *, unsigned int > > &  setCoinsRet,
CAmount nValueRet,
bool  fUseInstantSend = false 
) const

Shuffle and select coins until nTargetValue is reached while avoiding small change; This method is stochastic for some inputs and upon completion the coin set and corresponding actual target value is assembled

Definition at line 2498 of file wallet.cpp.

◆ SetAddressBook()

bool CWallet::SetAddressBook ( const CTxDestination address,
const std::string &  strName,
const std::string &  purpose 
)

◆ SetDefaultKey()

bool CWallet::SetDefaultKey ( const CPubKey vchPubKey)

Definition at line 3728 of file wallet.cpp.

Referenced by AppInit2().

◆ TopUpKeyPool()

bool CWallet::TopUpKeyPool ( unsigned int  kpSize = 0)

Definition at line 3779 of file wallet.cpp.

Referenced by getnewaddress(), getrawchangeaddress(), keypoolrefill(), and walletpassphrase().

◆ UnlockAllCoins()

void CWallet::UnlockAllCoins ( )

Definition at line 4215 of file wallet.cpp.

Referenced by lockunspent().

◆ UnlockCoin()

void CWallet::UnlockCoin ( COutPoint output)

◆ UpdatedTransaction()

bool CWallet::UpdatedTransaction ( const uint256 hashTx)
virtual

Reimplemented from CValidationInterface.

Definition at line 4168 of file wallet.cpp.

Referenced by CInstantSend::UpdateLockedTransaction().

◆ ZapWalletTx()

DBErrors CWallet::ZapWalletTx ( std::vector< CWalletTx > &  vWtx)

Definition at line 3657 of file wallet.cpp.

Referenced by AppInit2().