-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Fix Timelock Recovery plugin for watch wallets #9862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Timelock Recovery plugin for watch wallets #9862
Conversation
b7a70e5
to
8de18de
Compare
8de18de
to
0f02f92
Compare
Is there a reason for the extra check on electrum/electrum/plugins/timelock_recovery/qt.py Lines 408 to 412 in e30392c
|
@accumulator You're right, it's redundant. |
I cherry-picked a slightly changed version of your last commit to master, in 2c7afac |
510d4d1
to
53bf51d
Compare
@accumulator Great, I've removed my commit and rebased the branch. |
53bf51d
to
ee257b3
Compare
ee257b3
to
20c6553
Compare
recovery_tx_fee_label.setText(_("Fee: {}").format(self.config.format_amount_and_units(context.recovery_tx.get_fee()))) | ||
if create_cancel_cb.isChecked(): | ||
context.cancellation_tx = context.make_unsigned_cancellation_tx(fee_policy) | ||
assert all(tx_input.is_segwit() for tx_input in context.cancellation_tx.inputs()) | ||
cancellation_tx_complete_label.setText(_("✓ Signed" if context.cancellation_tx.is_complete() else "")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you separate the logic from the translation in these labels?
e.g. cancellation_tx_complete_label.setText(_("✓ Signed") if context.alert_tx.is_complete() else "")
Its more readable and prevents strings from not getting registered for translation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✓ Done 😄
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 |
Long Term recovery transactions should have a high fee policy, because we don't know when we will broadcast them. On the other hand, they won't need to be urgent when broadcasted either.
There could be flows where sign_transaction will return without actually signing the transaction. We also want to add the ability to sign the transactions externally, so here we check if they are already signed.
The Next button should be clicked only after the transactions have been signed
We don't want the txid to change because the new transaction has a new random locktime.
In the current logic, even if prompt_if_unsaved was False, the prompt will appear if the signing is complete (and unsaved).
It's ok to click the View button, then press Sign, and then close the window the signed transaction will be used by the on_closed callback
20c6553
to
afc62eb
Compare
@f321x Thanks. Fixed and rebased from master branch. |
Thx. |
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).