From cf6ef3c1397fb41eb62ba5bc28a9a34a12f3b9aa Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Fri, 16 Mar 2018 14:33:29 -0400 Subject: [PATCH 1/2] shuffle sendmany recipients ordering to shuffle tx outputs --- src/wallet/rpcwallet.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index dbc48834ffd..365dedfceb2 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; From 6acb02d635da68c0506b49a8dd27c2c3ded4addf Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Wed, 21 Mar 2018 14:50:12 -0400 Subject: [PATCH 2/2] add release note for sendmany output shuffling --- doc/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/release-notes.md b/doc/release-notes.md index b183ee0a594..973fd3c84cf 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 ---------------------