{"action":"closed","issue":{"url":"https://api.github.com/repos/bitpay/bitcore/issues/1141","labels_url":"https://api.github.com/repos/bitpay/bitcore/issues/1141/labels{/name}","comments_url":"https://api.github.com/repos/bitpay/bitcore/issues/1141/comments","events_url":"https://api.github.com/repos/bitpay/bitcore/issues/1141/events","html_url":"https://github.com/bitpay/bitcore/issues/1141","id":60676357,"number":1141,"title":"Add Transaction.randomizeOutputs() for privacy","user":{"login":"maraoz","id":287189,"avatar_url":"https://avatars.githubusercontent.com/u/287189?v=3","gravatar_id":"","url":"https://api.github.com/users/maraoz","html_url":"https://github.com/maraoz","followers_url":"https://api.github.com/users/maraoz/followers","following_url":"https://api.github.com/users/maraoz/following{/other_user}","gists_url":"https://api.github.com/users/maraoz/gists{/gist_id}","starred_url":"https://api.github.com/users/maraoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maraoz/subscriptions","organizations_url":"https://api.github.com/users/maraoz/orgs","repos_url":"https://api.github.com/users/maraoz/repos","events_url":"https://api.github.com/users/maraoz/events{/privacy}","received_events_url":"https://api.github.com/users/maraoz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bitpay/bitcore/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-11T15:28:16Z","updated_at":"2015-03-11T18:53:01Z","closed_at":"2015-03-11T18:53:01Z","body":"Suggested by: @matiu \r\ncode prototype by @eordano:\r\n```\r\nvar randomizeOutputs = function(tx) {\r\n  var newOutputs = randomizeArray(tx.outputs);\r\n  var changeIndex = 0;\r\n  while (tx.outputs[tx._changeIndex] !== newOutputs[changeIndex]) changeIndex++;\r\n  tx.outputs = newOutputs;\r\n  tx._changeIndex = changeIndex;\r\n};\r\n```"}}