tMerge pull request #134 from kyuupichan/randomchange - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit b9f3e8a9ac80d88f121ae395edecfc1e2c24b5ae DIR parent ca2992113f45ecaeb64cdc3f95ab5d4735f01135 HTML Author: ThomasV <thomasv1@gmx.de> Date: Wed, 23 Jan 2013 06:41:30 -0800 Merge pull request #134 from kyuupichan/randomchange Place the change output in a random position Diffstat: M lib/wallet.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- DIR diff --git a/lib/wallet.py b/lib/wallet.py t@@ -610,7 +610,9 @@ class Wallet: # normally, the update thread should ensure that the last change address is unused if not change_addr: change_addr = self.change_addresses[-1] - outputs.append( ( change_addr, change_amount) ) + # Insert the change output at a random position in the outputs + posn = random.randint(0, len(outputs)) + outputs[posn:posn] = [( change_addr, change_amount)] return outputs def sign_inputs( self, inputs, outputs, password ):