aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorinstagibbs <gsanders87@gmail.com>2016-11-15 11:31:40 -0500
committerinstagibbs <gsanders87@gmail.com>2016-11-15 11:56:45 -0500
commitea83d0098a2eb29a3b1398f3ecf907f7eece1eee (patch)
tree071f45e8768fe3bc251a7c6a39e5120696fc4b13 /src/wallet
parent018a4eb120dcdab73f07ca02d18a5c8843509d67 (diff)
SendMoney: use already-calculated balance
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/rpcwallet.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index 5a22e0278d..0e2105fc59 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -362,7 +362,7 @@ static void SendMoney(const CTxDestination &address, CAmount nValue, bool fSubtr
CRecipient recipient = {scriptPubKey, nValue, fSubtractFeeFromAmount};
vecSend.push_back(recipient);
if (!pwalletMain->CreateTransaction(vecSend, wtxNew, reservekey, nFeeRequired, nChangePosRet, strError)) {
- if (!fSubtractFeeFromAmount && nValue + nFeeRequired > pwalletMain->GetBalance())
+ if (!fSubtractFeeFromAmount && nValue + nFeeRequired > curBalance)
strError = strprintf("Error: This transaction requires a transaction fee of at least %s", FormatMoney(nFeeRequired));
throw JSONRPCError(RPC_WALLET_ERROR, strError);
}