Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show First 20 Lines • Show All 458 Lines • ▼ Show 20 Lines | public: | ||||
std::set<uint256> GetConflicts() const; | std::set<uint256> GetConflicts() const; | ||||
}; | }; | ||||
class COutput { | class COutput { | ||||
public: | public: | ||||
const CWalletTx *tx; | const CWalletTx *tx; | ||||
int i; | int i; | ||||
int nDepth; | int nDepth; | ||||
/** Whether we have the private keys to spend this output */ | |||||
bool fSpendable; | bool fSpendable; | ||||
/** Whether we know how to spend this output, ignoring the lack of keys */ | |||||
bool fSolvable; | bool fSolvable; | ||||
/** | |||||
* Whether this output is considered safe to spend. Unconfirmed transactions | |||||
* from outside keys are considered unsafe and will not be used to fund new | |||||
* spending transactions. | |||||
*/ | |||||
bool fSafe; | |||||
COutput(const CWalletTx *txIn, int iIn, int nDepthIn, bool fSpendableIn, | COutput(const CWalletTx *txIn, int iIn, int nDepthIn, bool fSpendableIn, | ||||
bool fSolvableIn) { | bool fSolvableIn, bool fSafeIn) { | ||||
tx = txIn; | tx = txIn; | ||||
i = iIn; | i = iIn; | ||||
nDepth = nDepthIn; | nDepth = nDepthIn; | ||||
fSpendable = fSpendableIn; | fSpendable = fSpendableIn; | ||||
fSolvable = fSolvableIn; | fSolvable = fSolvableIn; | ||||
fSafe = fSafeIn; | |||||
} | } | ||||
std::string ToString() const; | std::string ToString() const; | ||||
}; | }; | ||||
/** Private key that includes an expiration date in case it never gets used. */ | /** Private key that includes an expiration date in case it never gets used. */ | ||||
class CWalletKey { | class CWalletKey { | ||||
public: | public: | ||||
▲ Show 20 Lines • Show All 265 Lines • ▼ Show 20 Lines | public: | ||||
bool CanSupportFeature(enum WalletFeature wf) const { | bool CanSupportFeature(enum WalletFeature wf) const { | ||||
AssertLockHeld(cs_wallet); | AssertLockHeld(cs_wallet); | ||||
return nWalletMaxVersion >= wf; | return nWalletMaxVersion >= wf; | ||||
} | } | ||||
/** | /** | ||||
* populate vCoins with vector of available COutputs. | * populate vCoins with vector of available COutputs. | ||||
*/ | */ | ||||
void AvailableCoins(std::vector<COutput> &vCoins, | void AvailableCoins(std::vector<COutput> &vCoins, bool fOnlySafe = true, | ||||
bool fOnlyConfirmed = true, | |||||
const CCoinControl *coinControl = nullptr, | const CCoinControl *coinControl = nullptr, | ||||
bool fIncludeZeroValue = false) const; | bool fIncludeZeroValue = false) const; | ||||
/** | /** | ||||
* Shuffle and select coins until nTargetValue is reached while avoiding | * Shuffle and select coins until nTargetValue is reached while avoiding | ||||
* small change; This method is stochastic for some inputs and upon | * small change; This method is stochastic for some inputs and upon | ||||
* completion the coin set and corresponding actual target value is | * completion the coin set and corresponding actual target value is | ||||
* assembled. | * assembled. | ||||
▲ Show 20 Lines • Show All 443 Lines • Show Last 20 Lines |