From e87ed44f8494e0a665ff917bda8325d64b0f4c4b Mon Sep 17 00:00:00 2001 From: thomasv Date: Mon, 26 Nov 2012 15:08:35 +0100 Subject: [PATCH] send change to last address of the input list --- lib/wallet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/wallet.py b/lib/wallet.py index 373bf699..b252f452 100644 --- a/lib/wallet.py +++ b/lib/wallet.py @@ -769,8 +769,8 @@ class Wallet: raise ValueError("Not enough funds") if not self.use_change and not change_addr: - change_addr = inputs[0][0] - print "Sending change to", change_addr + change_addr = inputs[-1][0] + print_error( "Sending change to", change_addr ) outputs = self.choose_tx_outputs( to_address, amount, fee, total, change_addr ) s_inputs = self.sign_inputs( inputs, outputs, password )