Hi guys. I am working on a plugin for Electrum (v1.7.3). I just noticed that currently making a tx with multiple inputs and outputs is broken so I am trying to add this to Electrum.
I am very new to python so don't be harsh. I am learning here and asking for help
I am having a small problem understanding the code and I would love some help. thank you in advance.
In
/lib/commands.py for the function
_mktx. The last variable it passes to
wallet.mktx is
domain which is an array of addresses which are tested with is_valid(add) just like the outputs, so it is safe to assume they are bitcoin addresses. However in the implementation of
wallet.mktx in
/lib/wallet.py I saw this:
def mktx(self, outputs, password, fee=None, change_addr=None, account=None ):
"""
create a transaction
account parameter:
None means use all accounts
-1 means imported keys
0, 1, etc are seed accounts
"""
So I noticed that the comment suggests
account to be an integer value
! Following the variable led me to
get_account_addresses in
/lib/wallet.py where it is really treated as an Integer!:
def get_account_addresses(self, a, include_change=True):
if a is None:
o = self.addresses(True)
elif a == -1:
o = self.imported_keys.keys()
else:
ac = self.accounts[a]
o = ac[0][:]
if include_change: o += ac[1]
return o
So I guess what I am asking of you is to tell me and help me understand is that supposed to work and how would it!
, or simply half baked code which have to be fixed?