fix for change address

This commit is contained in:
ThomasV 2012-06-17 09:51:15 +02:00
parent 3801956bee
commit 37af22cc6f
2 changed files with 3 additions and 5 deletions

View File

@ -1,3 +1,3 @@
ELECTRUM_VERSION = "0.59a" ELECTRUM_VERSION = "0.59b"
SEED_VERSION = 4 # bump this everytime the seed generation is modified SEED_VERSION = 4 # bump this everytime the seed generation is modified
TRANSLATION_ID = 27842 # version of the wiki page TRANSLATION_ID = 27842 # version of the wiki page

View File

@ -881,18 +881,16 @@ class Wallet:
tx['default_label'] = default_label tx['default_label'] = default_label
def mktx(self, to_address, amount, label, password, fee=None, from_addr= None): def mktx(self, to_address, amount, label, password, fee=None, change_addr=None, from_addr= None):
if not self.is_valid(to_address): if not self.is_valid(to_address):
raise BaseException("Invalid address") raise BaseException("Invalid address")
inputs, total, fee = self.choose_tx_inputs( amount, fee, from_addr ) inputs, total, fee = self.choose_tx_inputs( amount, fee, from_addr )
if not inputs: if not inputs:
raise BaseException("Not enough funds") raise BaseException("Not enough funds")
if not self.use_change: if not self.use_change and not change_addr:
change_addr = inputs[0][0] change_addr = inputs[0][0]
print "sending change to", change_addr print "sending change to", change_addr
else:
change_addr = None
outputs = self.choose_tx_outputs( to_address, amount, fee, total, change_addr ) outputs = self.choose_tx_outputs( to_address, amount, fee, total, change_addr )
s_inputs = self.sign_inputs( inputs, outputs, password ) s_inputs = self.sign_inputs( inputs, outputs, password )