diff options
author | John Newbery <john@johnnewbery.com> | 2018-06-18 12:17:42 -0400 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2018-06-18 12:33:16 -0400 |
commit | df10f07db178d84b3def9f0b99d9b7c92e4227a9 (patch) | |
tree | 6b380478508dc1be8941de009581fcda024e99b7 | |
parent | e209184101e3de9138452fb973e2f379f9eacdc8 (diff) | |
download | bitcoin-df10f07db178d84b3def9f0b99d9b7c92e4227a9.tar.xz |
[wallet] Don't use accounts when checking balance in sendmany
-rw-r--r-- | src/wallet/rpcwallet.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 357ed16a17..0aabf26108 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()); |