mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-19 00:49:49 +00:00
hardware wallet support for locktime
This commit is contained in:
parent
183af4ae3a
commit
853b6169ed
3 changed files with 4 additions and 5 deletions
|
@ -446,7 +446,7 @@ class Abstract_Wallet(PrintError):
|
||||||
status = _('Unconfirmed')
|
status = _('Unconfirmed')
|
||||||
if fee is None:
|
if fee is None:
|
||||||
fee = self.tx_fees.get(tx_hash)
|
fee = self.tx_fees.get(tx_hash)
|
||||||
if fee:
|
if fee and self.network.config.has_fee_estimates():
|
||||||
size = tx.estimated_size()
|
size = tx.estimated_size()
|
||||||
fee_per_kb = fee * 1000 / size
|
fee_per_kb = fee * 1000 / size
|
||||||
exp_n = self.network.config.reverse_dynfee(fee_per_kb)
|
exp_n = self.network.config.reverse_dynfee(fee_per_kb)
|
||||||
|
@ -854,8 +854,7 @@ class Abstract_Wallet(PrintError):
|
||||||
# Sort the inputs and outputs deterministically
|
# Sort the inputs and outputs deterministically
|
||||||
tx.BIP_LI01_sort()
|
tx.BIP_LI01_sort()
|
||||||
# Timelock tx to current height.
|
# Timelock tx to current height.
|
||||||
# Disabled until hardware wallets support it
|
tx.locktime = self.get_local_height()
|
||||||
# tx.locktime = self.get_local_height()
|
|
||||||
run_hook('make_unsigned_transaction', self, tx)
|
run_hook('make_unsigned_transaction', self, tx)
|
||||||
return tx
|
return tx
|
||||||
|
|
||||||
|
|
|
@ -408,7 +408,7 @@ class Ledger_KeyStore(Hardware_KeyStore):
|
||||||
self.handler.show_message(_("Confirmed. Signing Transaction..."))
|
self.handler.show_message(_("Confirmed. Signing Transaction..."))
|
||||||
else:
|
else:
|
||||||
# Sign input with the provided PIN
|
# Sign input with the provided PIN
|
||||||
inputSignature = self.get_client().untrustedHashSign(inputsPaths[inputIndex], pin)
|
inputSignature = self.get_client().untrustedHashSign(inputsPaths[inputIndex], pin, lockTime=tx.locktime)
|
||||||
inputSignature[0] = 0x30 # force for 1.4.9+
|
inputSignature[0] = 0x30 # force for 1.4.9+
|
||||||
signatures.append(inputSignature)
|
signatures.append(inputSignature)
|
||||||
inputIndex = inputIndex + 1
|
inputIndex = inputIndex + 1
|
||||||
|
|
|
@ -240,7 +240,7 @@ class TrezorCompatiblePlugin(HW_PluginBase):
|
||||||
client = self.get_client(keystore)
|
client = self.get_client(keystore)
|
||||||
inputs = self.tx_inputs(tx, True)
|
inputs = self.tx_inputs(tx, True)
|
||||||
outputs = self.tx_outputs(keystore.get_derivation(), tx)
|
outputs = self.tx_outputs(keystore.get_derivation(), tx)
|
||||||
signed_tx = client.sign_tx(self.get_coin_name(), inputs, outputs)[1]
|
signed_tx = client.sign_tx(self.get_coin_name(), inputs, outputs, lock_time=tx.locktime)[1]
|
||||||
raw = signed_tx.encode('hex')
|
raw = signed_tx.encode('hex')
|
||||||
tx.update_signatures(raw)
|
tx.update_signatures(raw)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue