From cf6ef3c1397fb41eb62ba5bc28a9a34a12f3b9aa Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Fri, 16 Mar 2018 14:33:29 -0400 Subject: shuffle sendmany recipients ordering to shuffle tx outputs --- src/wallet/rpcwallet.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') 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; -- cgit v1.2.3