aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet.h')
-rw-r--r--src/wallet.h36
1 files changed, 34 insertions, 2 deletions
diff --git a/src/wallet.h b/src/wallet.h
index 618a00623a..5bf38699ef 100644
--- a/src/wallet.h
+++ b/src/wallet.h
@@ -14,6 +14,7 @@
class CWalletTx;
class CReserveKey;
class CWalletDB;
+class COutput;
/** (client) version numbers for particular wallet features */
enum WalletFeature
@@ -60,7 +61,6 @@ public:
class CWallet : public CCryptoKeyStore
{
private:
- bool SelectCoinsMinConf(int64 nTargetValue, int nConfMine, int nConfTheirs, std::set<std::pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64& nValueRet) const;
bool SelectCoins(int64 nTargetValue, std::set<std::pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64& nValueRet) const;
CWalletDB *pwalletdbEncryption;
@@ -68,7 +68,7 @@ private:
// the current wallet version: clients below this version are not able to load the wallet
int nWalletVersion;
- // the maxmimum wallet format version: memory-only variable that specifies to what version this wallet may be upgraded
+ // the maximum wallet format version: memory-only variable that specifies to what version this wallet may be upgraded
int nWalletMaxVersion;
public:
@@ -112,6 +112,9 @@ public:
// check whether we are allowed to upgrade (or already support) to the named feature
bool CanSupportFeature(enum WalletFeature wf) { return nWalletMaxVersion >= wf; }
+ void AvailableCoins(std::vector<COutput>& vCoins, bool fOnlyConfirmed=true) const;
+ bool SelectCoinsMinConf(int64 nTargetValue, int nConfMine, int nConfTheirs, std::vector<COutput> vCoins, std::set<std::pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64& nValueRet) const;
+
// keystore implementation
// Generate a new key
CPubKey GenerateNewKey();
@@ -144,6 +147,7 @@ public:
void ResendWalletTransactions();
int64 GetBalance() const;
int64 GetUnconfirmedBalance() const;
+ int64 GetImmatureBalance() const;
bool CreateTransaction(const std::vector<std::pair<CScript, int64> >& vecSend, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet);
bool CreateTransaction(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet);
bool CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey);
@@ -601,6 +605,34 @@ public:
};
+
+
+class COutput
+{
+public:
+ const CWalletTx *tx;
+ int i;
+ int nDepth;
+
+ COutput(const CWalletTx *txIn, int iIn, int nDepthIn)
+ {
+ tx = txIn; i = iIn; nDepth = nDepthIn;
+ }
+
+ std::string ToString() const
+ {
+ return strprintf("COutput(%s, %d, %d) [%s]", tx->GetHash().ToString().substr(0,10).c_str(), i, nDepth, FormatMoney(tx->vout[i].nValue).c_str());
+ }
+
+ void print() const
+ {
+ printf("%s\n", ToString().c_str());
+ }
+};
+
+
+
+
/** Private key that includes an expiration date in case it never gets used. */
class CWalletKey
{