aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Newbery <[email protected]>2018-06-18 12:17:42 -0400
committerJohn Newbery <[email protected]>2018-06-18 12:33:16 -0400
commitdf10f07db178d84b3def9f0b99d9b7c92e4227a9 (patch)
tree6b380478508dc1be8941de009581fcda024e99b7 /src
parent[wallet] deprecate sendfrom RPC method. (diff)
downloaddiscoin-df10f07db178d84b3def9f0b99d9b7c92e4227a9.tar.xz
discoin-df10f07db178d84b3def9f0b99d9b7c92e4227a9.zip
[wallet] Don't use accounts when checking balance in sendmany
Diffstat (limited to 'src')
-rw-r--r--src/wallet/rpcwallet.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index 357ed16a1..0aabf2610 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -1263,9 +1263,11 @@ static UniValue sendmany(const JSONRPCRequest& request)
EnsureWalletIsUnlocked(pwallet);
// Check funds
- CAmount nBalance = pwallet->GetLegacyBalance(ISMINE_SPENDABLE, nMinDepth, &strAccount);
- if (totalAmount > nBalance)
+ if (IsDeprecatedRPCEnabled("accounts") && totalAmount > pwallet->GetLegacyBalance(ISMINE_SPENDABLE, nMinDepth, &strAccount)) {
throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Account has insufficient funds");
+ } else if (!IsDeprecatedRPCEnabled("accounts") && totalAmount > pwallet->GetLegacyBalance(ISMINE_SPENDABLE, nMinDepth, nullptr)) {
+ throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Wallet has insufficient funds");
+ }
// Shuffle recipient list
std::shuffle(vecSend.begin(), vecSend.end(), FastRandomContext());