Skip to content

Commit 2c7afac

Browse files
committed
timelock_recovery: remove redundant pi.parse_output() call and use pi fields directly
1 parent 09f99a2 commit 2c7afac

File tree

1 file changed

+2
-6
lines changed
  • electrum/plugins/timelock_recovery

1 file changed

+2
-6
lines changed

electrum/plugins/timelock_recovery/qt.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,12 +405,8 @@ def _validate_input_values(
405405
payto_e.setStyleSheet(ColorScheme.RED.as_stylesheet(True))
406406
payto_e.setToolTip("Invalid address type - must be a Bitcoin address.")
407407
return False
408-
scriptpubkey, is_address = pi.parse_output(pi.text.strip())
409-
if not is_address:
410-
payto_e.setStyleSheet(ColorScheme.RED.as_stylesheet(True))
411-
payto_e.setToolTip("Must be a valid address, not a script.")
412-
return False
413-
context.outputs = [PartialTxOutput(scriptpubkey=scriptpubkey, value='!')]
408+
assert pi.spk and pi.spk_is_address
409+
context.outputs = [PartialTxOutput(scriptpubkey=pi.spk, value='!')]
414410
return True
415411

416412
def start_plan(self, context: TimelockRecoveryContext):

0 commit comments

Comments
 (0)