aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.cpp
diff options
context:
space:
mode:
authorGavin Andresen <[email protected]>2011-09-26 06:05:11 -0700
committerGavin Andresen <[email protected]>2011-09-26 06:05:11 -0700
commitf7f2a36925bb560363f691fc3ca3dec83830dd15 (patch)
treec09327d910abe4e7947c53dcbb5f15b01ab194c1 /src/wallet.cpp
parentMerge pull request #528 from TheBlueMatt/gitian-downloader (diff)
parentmove current qt specific readme to doc/, restore original README.md (diff)
downloaddiscoin-f7f2a36925bb560363f691fc3ca3dec83830dd15.tar.xz
discoin-f7f2a36925bb560363f691fc3ca3dec83830dd15.zip
Merge pull request #521 from laanwj/qt
Qt GUI
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r--src/wallet.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp
index 8bbb80cf2..d78e47039 100644
--- a/src/wallet.cpp
+++ b/src/wallet.cpp
@@ -260,7 +260,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn)
if (fInsertedNew || fUpdated)
if (!wtx.WriteToDisk())
return false;
-
+#ifndef QT_GUI
// If default receiving address gets used, replace it with a new one
CScript scriptDefaultKey;
scriptDefaultKey.SetBitcoinAddress(vchDefaultKey);
@@ -276,7 +276,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn)
}
}
}
-
+#endif
// Notify UI
vWalletUpdated.push_back(hash);
@@ -728,6 +728,21 @@ int64 CWallet::GetBalance() const
return nTotal;
}
+int64 CWallet::GetUnconfirmedBalance() const
+{
+ int64 nTotal = 0;
+ CRITICAL_BLOCK(cs_wallet)
+ {
+ for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
+ {
+ const CWalletTx* pcoin = &(*it).second;
+ if (pcoin->IsFinal() && pcoin->IsConfirmed())
+ continue;
+ nTotal += pcoin->GetAvailableCredit();
+ }
+ }
+ return nTotal;
+}
bool CWallet::SelectCoinsMinConf(int64 nTargetValue, int nConfMine, int nConfTheirs, set<pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64& nValueRet) const
{