Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 1,343 Lines • ▼ Show 20 Lines | static UniValue sendmany(const Config &config, const JSONRPCRequest &request) { | ||||
// Check funds | // Check funds | ||||
Amount nBalance = | Amount nBalance = | ||||
pwallet->GetLegacyBalance(ISMINE_SPENDABLE, nMinDepth, &strAccount); | pwallet->GetLegacyBalance(ISMINE_SPENDABLE, nMinDepth, &strAccount); | ||||
if (totalAmount > nBalance) { | if (totalAmount > nBalance) { | ||||
throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, | throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, | ||||
"Account has insufficient funds"); | "Account has insufficient funds"); | ||||
} | } | ||||
// Shuffle recipient list | |||||
std::shuffle(vecSend.begin(), vecSend.end(), FastRandomContext()); | |||||
// Send | // Send | ||||
CReserveKey keyChange(pwallet); | CReserveKey keyChange(pwallet); | ||||
Amount nFeeRequired = Amount::zero(); | Amount nFeeRequired = Amount::zero(); | ||||
int nChangePosRet = -1; | int nChangePosRet = -1; | ||||
std::string strFailReason; | std::string strFailReason; | ||||
CTransactionRef tx; | CTransactionRef tx; | ||||
CCoinControl coinControl; | CCoinControl coinControl; | ||||
bool fCreated = | bool fCreated = | ||||
▲ Show 20 Lines • Show All 3,003 Lines • Show Last 20 Lines |