mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-01 09:45:18 +00:00
Removed hard coded purpose and coin_type (provided by Wallet.get_address_index)
Only look up address when not a coinbase transaction
This commit is contained in:
parent
94a5d26013
commit
49c2ba5b12
1 changed files with 8 additions and 8 deletions
|
@ -179,7 +179,7 @@ class TrezorWallet(NewWallet):
|
||||||
|
|
||||||
def address_id(self, address):
|
def address_id(self, address):
|
||||||
account_id, (change, address_index) = self.get_address_index(address)
|
account_id, (change, address_index) = self.get_address_index(address)
|
||||||
return "44'/0'/%s'/%d/%d" % (account_id, change, address_index)
|
return "%s/%d/%d" % (account_id, change, address_index)
|
||||||
|
|
||||||
def create_main_account(self, password):
|
def create_main_account(self, password):
|
||||||
self.create_account('Main account', None) #name, empty password
|
self.create_account('Main account', None) #name, empty password
|
||||||
|
@ -262,17 +262,17 @@ class TrezorWallet(NewWallet):
|
||||||
|
|
||||||
for txinput in tx.inputs:
|
for txinput in tx.inputs:
|
||||||
txinputtype = types.TxInputType()
|
txinputtype = types.TxInputType()
|
||||||
address = txinput['address']
|
|
||||||
try:
|
|
||||||
address_path = self.address_id(address)
|
|
||||||
address_n = self.get_client().expand_path(address_path)
|
|
||||||
txinputtype.address_n.extend(address_n)
|
|
||||||
except: pass
|
|
||||||
|
|
||||||
if ('is_coinbase' in txinput and txinput['is_coinbase']):
|
if ('is_coinbase' in txinput and txinput['is_coinbase']):
|
||||||
prev_hash = "\0"*32
|
prev_hash = "\0"*32
|
||||||
prev_index = 0xffffffff # signed int -1
|
prev_index = 0xffffffff # signed int -1
|
||||||
else:
|
else:
|
||||||
|
address = txinput['address']
|
||||||
|
try:
|
||||||
|
address_path = self.address_id(address)
|
||||||
|
address_n = self.get_client().expand_path(address_path)
|
||||||
|
txinputtype.address_n.extend(address_n)
|
||||||
|
except: pass
|
||||||
|
|
||||||
prev_hash = unhexlify(txinput['prevout_hash'])
|
prev_hash = unhexlify(txinput['prevout_hash'])
|
||||||
prev_index = txinput['prevout_n']
|
prev_index = txinput['prevout_n']
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue