aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGregory Sanders <gsanders87@gmail.com>2018-03-16 14:33:29 -0400
committerGregory Sanders <gsanders87@gmail.com>2018-03-23 08:56:08 -0400
commitcf6ef3c1397fb41eb62ba5bc28a9a34a12f3b9aa (patch)
treeb2b508b7420d26954f796dad2d2ee1770d175f75 /src
parentcead84b72d27517338ac3c49eaaed4db07352f41 (diff)
shuffle sendmany recipients ordering to shuffle tx outputs
Diffstat (limited to 'src')
-rw-r--r--src/wallet/rpcwallet.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index dbc48834ff..365dedfceb 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -1145,6 +1145,9 @@ UniValue sendmany(const JSONRPCRequest& request)
if (totalAmount > nBalance)
throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Account has insufficient funds");
+ // Shuffle recipient list
+ std::shuffle(vecSend.begin(), vecSend.end(), FastRandomContext());
+
// Send
CReserveKey keyChange(pwallet);
CAmount nFeeRequired = 0;