electrum icon indicating copy to clipboard operation
electrum copied to clipboard

Fix Timelock Recovery plugin for watch wallets

Open oren-z0 opened this issue 8 months ago • 4 comments

In watch-wallets (i.e. air-gapped solutions), the transactions can be signed by clicking the View button, exporting the PSBT, loading and signing it on a different device, and then merging the signature.

Added assertions that all the transactions are completed before moving to the final window (for downloading PDFs and JSONs).

oren-z0 avatar May 24 '25 01:05 oren-z0

Is there a reason for the extra check on parse_output? This looks to be already covered by the check right above it.

https://github.com/spesmilo/electrum/blob/e30392cd161de8dfcf5981c4d528f82efd4645c3/electrum/plugins/timelock_recovery/qt.py#L408-L412

accumulator avatar Jun 11 '25 09:06 accumulator

@accumulator You're right, it's redundant. I think I wrote it before I wrote the or pi.type != PaymentIdentifierType.SPK or not pi.spk_is_address part. I'll replace it with a simple assert just in case.

oren-z0 avatar Jun 11 '25 21:06 oren-z0

I cherry-picked a slightly changed version of your last commit to master, in 2c7afacbe1913241e6cc319131c6913ada06a06d

accumulator avatar Jun 12 '25 08:06 accumulator

@accumulator Great, I've removed my commit and rebased the branch.

oren-z0 avatar Jun 12 '25 14:06 oren-z0

Tested, works fine for me with a regular singlesig and a watchonly wallet. One comment on the code (see above).

Two things i noticed could may be done to improve UX a bit (unrelated to this PR), adding a MIN/MAX button to the Cancellation time-window (days) field as the help text is a bit hidden, this would make it more intuitive to figure out the limits instead of brute forcing the input field until it turns red. And wrapping the PDF saving call into a WaitingDialog as it blocks the GUI for a couple of seconds which would feel better if it gave some feedback (especially on slow computers).

f321x avatar Jul 03 '25 12:07 f321x

@f321x Thanks. Fixed and rebased from master branch.

oren-z0 avatar Jul 03 '25 12:07 oren-z0

Thx.

SomberNight avatar Jul 04 '25 06:07 SomberNight