Skip to content

Commit c01f16a

Browse files
committed
Merge #9165: SendMoney: use already-calculated balance
ea83d00 SendMoney: use already-calculated balance (instagibbs)
2 parents 43e8150 + ea83d00 commit c01f16a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wallet/rpcwallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ static void SendMoney(const CTxDestination &address, CAmount nValue, bool fSubtr
362362
CRecipient recipient = {scriptPubKey, nValue, fSubtractFeeFromAmount};
363363
vecSend.push_back(recipient);
364364
if (!pwalletMain->CreateTransaction(vecSend, wtxNew, reservekey, nFeeRequired, nChangePosRet, strError)) {
365-
if (!fSubtractFeeFromAmount && nValue + nFeeRequired > pwalletMain->GetBalance())
365+
if (!fSubtractFeeFromAmount && nValue + nFeeRequired > curBalance)
366366
strError = strprintf("Error: This transaction requires a transaction fee of at least %s", FormatMoney(nFeeRequired));
367367
throw JSONRPCError(RPC_WALLET_ERROR, strError);
368368
}

0 commit comments

Comments
 (0)