check if address is imported before index lookup
This commit is contained in:
parent
736e1253f2
commit
b95911e2d7
|
@ -785,10 +785,12 @@ class Wallet:
|
||||||
pk_addresses = []
|
pk_addresses = []
|
||||||
for i in range(len(tx.inputs)):
|
for i in range(len(tx.inputs)):
|
||||||
txin = tx.inputs[i]
|
txin = tx.inputs[i]
|
||||||
account, is_change, n = self.get_address_index(txin['address'])
|
address = txin['address']
|
||||||
|
if address in self.imported_keys.keys(): continue
|
||||||
|
account, is_change, n = self.get_address_index(address)
|
||||||
|
txin['electrumKeyID'] = (account, is_change, n) # used by the server to find the key
|
||||||
pk_addr, redeemScript = self.sequences[account].get_input_info(is_change, n)
|
pk_addr, redeemScript = self.sequences[account].get_input_info(is_change, n)
|
||||||
txin['redeemScript'] = redeemScript
|
txin['redeemScript'] = redeemScript
|
||||||
txin['electrumKeyID'] = (account, is_change, n) # used by the server to find the key
|
|
||||||
pk_addresses.append(pk_addr)
|
pk_addresses.append(pk_addr)
|
||||||
|
|
||||||
# get all private keys at once.
|
# get all private keys at once.
|
||||||
|
|
Loading…
Reference in New Issue