shuffle sendmany recipients ordering to shuffle tx outputs

This commit is contained in:
Gregory Sanders committed 2018-03-23 08:56:08 -04:00
1 parent cead84b72d
commit cf6ef3c139
1 file changed
+3
+3
View File
@@ -1145,6 +1145,9 @@ UniValue sendmany(const JSONRPCRequest& request)
if (totalAmount > nBalance) if (totalAmount > nBalance)
throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Account has insufficient funds"); throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Account has insufficient funds");
// Shuffle recipient list
std::shuffle(vecSend.begin(), vecSend.end(), FastRandomContext());
// Send // Send
CReserveKey keyChange(pwallet); CReserveKey keyChange(pwallet);
CAmount nFeeRequired = 0; CAmount nFeeRequired = 0;