mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
[wallet] Don't use accounts when checking balance in sendmany
This commit is contained in:
parent
e209184101
commit
df10f07db1
1 changed files with 4 additions and 2 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue