fix for change address
This commit is contained in:
parent
3801956bee
commit
37af22cc6f
|
@ -1,3 +1,3 @@
|
|||
ELECTRUM_VERSION = "0.59a"
|
||||
ELECTRUM_VERSION = "0.59b"
|
||||
SEED_VERSION = 4 # bump this everytime the seed generation is modified
|
||||
TRANSLATION_ID = 27842 # version of the wiki page
|
||||
|
|
|
@ -881,18 +881,16 @@ class Wallet:
|
|||
|
||||
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):
|
||||
raise BaseException("Invalid address")
|
||||
inputs, total, fee = self.choose_tx_inputs( amount, fee, from_addr )
|
||||
if not inputs:
|
||||
raise BaseException("Not enough funds")
|
||||
|
||||
if not self.use_change:
|
||||
if not self.use_change and not change_addr:
|
||||
change_addr = inputs[0][0]
|
||||
print "sending change to", change_addr
|
||||
else:
|
||||
change_addr = None
|
||||
|
||||
outputs = self.choose_tx_outputs( to_address, amount, fee, total, change_addr )
|
||||
s_inputs = self.sign_inputs( inputs, outputs, password )
|
||||
|
|
Loading…
Reference in New Issue