mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-30 17:01:34 +00:00
Merge pull request #134 from kyuupichan/randomchange
Place the change output in a random position
This commit is contained in:
commit
b9f3e8a9ac
1 changed files with 3 additions and 1 deletions
|
@ -610,7 +610,9 @@ class Wallet:
|
||||||
# normally, the update thread should ensure that the last change address is unused
|
# normally, the update thread should ensure that the last change address is unused
|
||||||
if not change_addr:
|
if not change_addr:
|
||||||
change_addr = self.change_addresses[-1]
|
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
|
return outputs
|
||||||
|
|
||||||
def sign_inputs( self, inputs, outputs, password ):
|
def sign_inputs( self, inputs, outputs, password ):
|
||||||
|
|
Loading…
Add table
Reference in a new issue