Skip to content

Conversation

oren-z0
Copy link
Contributor

@oren-z0 oren-z0 commented May 24, 2025

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 oren-z0 force-pushed the fix-timelock-recovery-watch-wallets branch 9 times, most recently from b7a70e5 to 8de18de Compare May 30, 2025 14:07
@oren-z0 oren-z0 force-pushed the fix-timelock-recovery-watch-wallets branch from 8de18de to 0f02f92 Compare June 10, 2025 20:27
@accumulator
Copy link
Member

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

scriptpubkey, is_address = pi.parse_output(pi.text.strip())
if not is_address:
payto_e.setStyleSheet(ColorScheme.RED.as_stylesheet(True))
payto_e.setToolTip("Must be a valid address, not a script.")
return False

@oren-z0
Copy link
Contributor Author

oren-z0 commented Jun 11, 2025

@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.

@accumulator
Copy link
Member

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

@oren-z0 oren-z0 force-pushed the fix-timelock-recovery-watch-wallets branch from 510d4d1 to 53bf51d Compare June 12, 2025 14:12
@oren-z0
Copy link
Contributor Author

oren-z0 commented Jun 12, 2025

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

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 ""))
Copy link
Member

@f321x f321x Jul 3, 2025

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✓ Done 😄

@f321x
Copy link
Member

f321x commented Jul 3, 2025

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).

oren-z0 added 10 commits July 3, 2025 15:50
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
@oren-z0 oren-z0 force-pushed the fix-timelock-recovery-watch-wallets branch from 20c6553 to afc62eb Compare July 3, 2025 12:50
@oren-z0
Copy link
Contributor Author

oren-z0 commented Jul 3, 2025

@f321x Thanks. Fixed and rebased from master branch.

@SomberNight SomberNight merged commit ce90d8f into spesmilo:master Jul 4, 2025
13 of 14 checks passed
@SomberNight
Copy link
Member

Thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants