aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/release-notes.md1
-rw-r--r--src/wallet/rpcwallet.cpp3
2 files changed, 4 insertions, 0 deletions
diff --git a/doc/release-notes.md b/doc/release-notes.md
index b183ee0a59..973fd3c84c 100644
--- a/doc/release-notes.md
+++ b/doc/release-notes.md
@@ -73,6 +73,7 @@ RPC changes
- Wallet `listreceivedbylabel`, `listreceivedbyaccount` and `listunspent` RPCs
add `label` fields to returned JSON objects that previously only had
`account` fields.
+- `sendmany` now shuffles outputs to improve privacy, so any previously expected behavior with regards to output ordering can no longer be relied upon.
External wallet files
---------------------
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;