From f723d20c9a024927168d5d651804df747c3ca24d Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 20 Aug 2020 17:40:56 +0200 Subject: [PATCH] disable absolute locktime if sequence disabled --- .../sparrow/transaction/HeadersController.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java b/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java index f8564e85..4335aa44 100644 --- a/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java +++ b/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java @@ -313,12 +313,13 @@ public class HeadersController extends TransactionFormController implements Init } }); - locktimeNoneType.setDisable(!headersForm.isEditable()); - locktimeBlockType.setDisable(!headersForm.isEditable()); - locktimeDateType.setDisable(!headersForm.isEditable()); - locktimeBlock.setDisable(!headersForm.isEditable()); - locktimeDate.setDisable(!headersForm.isEditable()); - locktimeCurrentHeight.setDisable(!headersForm.isEditable()); + boolean locktimeEnabled = headersForm.getTransaction().isLocktimeSequenceEnabled(); + locktimeNoneType.setDisable(!headersForm.isEditable() || !locktimeEnabled); + locktimeBlockType.setDisable(!headersForm.isEditable() || !locktimeEnabled); + locktimeDateType.setDisable(!headersForm.isEditable() || !locktimeEnabled); + locktimeBlock.setDisable(!headersForm.isEditable() || !locktimeEnabled); + locktimeDate.setDisable(!headersForm.isEditable() || !locktimeEnabled); + locktimeCurrentHeight.setDisable(!headersForm.isEditable() || !locktimeEnabled); updateSize();