hw ledger: sign_transaction: add progress indicator
related: https://github.com/spesmilo/electrum/issues/7516
This commit is contained in:
@@ -22,6 +22,8 @@
|
|||||||
- during LN chan open, do not backup wallet automatically (#7733)
|
- during LN chan open, do not backup wallet automatically (#7733)
|
||||||
- Imported wallets: fix delete_address rm-ing too many txs (#7587)
|
- Imported wallets: fix delete_address rm-ing too many txs (#7587)
|
||||||
- fix potential deadlock in wallet.py (d3476b6b)
|
- fix potential deadlock in wallet.py (d3476b6b)
|
||||||
|
* Hardware wallets:
|
||||||
|
- ledger: add progress indicator to sign_transaction (#7516)
|
||||||
* fix the "--portable" flag for AppImage, and for pip installs (#7732)
|
* fix the "--portable" flag for AppImage, and for pip installs (#7732)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -444,10 +444,11 @@ class Ledger_KeyStore(Hardware_KeyStore):
|
|||||||
else:
|
else:
|
||||||
output = txout.address
|
output = txout.address
|
||||||
|
|
||||||
self.handler.show_message(_("Confirm Transaction on your Ledger device..."))
|
|
||||||
try:
|
try:
|
||||||
# Get trusted inputs from the original transactions
|
# Get trusted inputs from the original transactions
|
||||||
for utxo in inputs:
|
for input_idx, utxo in enumerate(inputs):
|
||||||
|
self.handler.show_message(_("Preparing transaction inputs...")
|
||||||
|
+ f" (phase1, {input_idx}/{len(inputs)})")
|
||||||
sequence = int_to_hex(utxo[5], 4)
|
sequence = int_to_hex(utxo[5], 4)
|
||||||
if segwitTransaction and not client_electrum.supports_segwit_trustedInputs():
|
if segwitTransaction and not client_electrum.supports_segwit_trustedInputs():
|
||||||
tmp = bfh(utxo[3])[::-1]
|
tmp = bfh(utxo[3])[::-1]
|
||||||
@@ -472,6 +473,7 @@ class Ledger_KeyStore(Hardware_KeyStore):
|
|||||||
chipInputs.append({'value' : tmp, 'sequence' : sequence})
|
chipInputs.append({'value' : tmp, 'sequence' : sequence})
|
||||||
redeemScripts.append(bfh(utxo[2]))
|
redeemScripts.append(bfh(utxo[2]))
|
||||||
|
|
||||||
|
self.handler.show_message(_("Confirm Transaction on your Ledger device..."))
|
||||||
# Sign all inputs
|
# Sign all inputs
|
||||||
firstTransaction = True
|
firstTransaction = True
|
||||||
inputIndex = 0
|
inputIndex = 0
|
||||||
@@ -493,6 +495,8 @@ class Ledger_KeyStore(Hardware_KeyStore):
|
|||||||
raise UserWarning()
|
raise UserWarning()
|
||||||
self.handler.show_message(_("Confirmed. Signing Transaction..."))
|
self.handler.show_message(_("Confirmed. Signing Transaction..."))
|
||||||
while inputIndex < len(inputs):
|
while inputIndex < len(inputs):
|
||||||
|
self.handler.show_message(_("Signing transaction...")
|
||||||
|
+ f" (phase2, {inputIndex}/{len(inputs)})")
|
||||||
singleInput = [chipInputs[inputIndex]]
|
singleInput = [chipInputs[inputIndex]]
|
||||||
client_ledger.startUntrustedTransaction(False, 0,
|
client_ledger.startUntrustedTransaction(False, 0,
|
||||||
singleInput, redeemScripts[inputIndex], version=tx.version)
|
singleInput, redeemScripts[inputIndex], version=tx.version)
|
||||||
@@ -505,6 +509,8 @@ class Ledger_KeyStore(Hardware_KeyStore):
|
|||||||
inputIndex = inputIndex + 1
|
inputIndex = inputIndex + 1
|
||||||
else:
|
else:
|
||||||
while inputIndex < len(inputs):
|
while inputIndex < len(inputs):
|
||||||
|
self.handler.show_message(_("Signing transaction...")
|
||||||
|
+ f" (phase2, {inputIndex}/{len(inputs)})")
|
||||||
client_ledger.startUntrustedTransaction(firstTransaction, inputIndex,
|
client_ledger.startUntrustedTransaction(firstTransaction, inputIndex,
|
||||||
chipInputs, redeemScripts[inputIndex], version=tx.version)
|
chipInputs, redeemScripts[inputIndex], version=tx.version)
|
||||||
# we don't set meaningful outputAddress, amount and fees
|
# we don't set meaningful outputAddress, amount and fees
|
||||||
|
|||||||
Reference in New Issue
Block a user