From 2f62a9e9c82f1776fe7a85850c74397a3225b320 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Tue, 4 Nov 2025 10:45:31 +0200 Subject: [PATCH] show signing keystores in transaction blockchain form for spends from multisig wallets --- .../transaction/HeadersController.java | 22 +++++++++++++++++++ .../com/sparrowwallet/sparrow/darktheme.css | 4 ++++ .../sparrow/transaction/headers.fxml | 3 +++ 3 files changed, 29 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java b/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java index 0e87444c..f2bb4078 100644 --- a/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java +++ b/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java @@ -4,6 +4,7 @@ import com.sparrowwallet.drongo.KeyPurpose; import com.sparrowwallet.drongo.SecureString; import com.sparrowwallet.drongo.Utils; import com.sparrowwallet.drongo.address.Address; +import com.sparrowwallet.drongo.policy.PolicyType; import com.sparrowwallet.drongo.protocol.*; import com.sparrowwallet.drongo.psbt.PSBT; import com.sparrowwallet.drongo.psbt.PSBTInput; @@ -181,6 +182,12 @@ public class HeadersController extends TransactionFormController implements Init @FXML private CopyableLabel blockTimestamp; + @FXML + private Field signedByField; + + @FXML + private CopyableLabel signedBy; + @FXML private Form blockchainSpacerForm; @@ -811,6 +818,7 @@ public class HeadersController extends TransactionFormController implements Init blockHeightField.managedProperty().bind(blockHeightField.visibleProperty()); blockTimestampField.managedProperty().bind(blockTimestampField.visibleProperty()); + signedByField.managedProperty().bind(signedByField.visibleProperty()); if(blockTransaction.getHeight() > 0) { blockHeightField.setVisible(true); @@ -828,6 +836,19 @@ public class HeadersController extends TransactionFormController implements Init } else { blockTimestampField.setVisible(false); } + + if(headersForm.getWalletTransaction() != null && headersForm.getWalletTransaction().getWallet() != null + && headersForm.getWalletTransaction().getWallet().getPolicyType() == PolicyType.MULTI + && headersForm.getWalletTransaction().getWallet().getDefaultPolicy().getNumSignaturesRequired() < headersForm.getWalletTransaction().getWallet().getKeystores().size()) { + signedByField.setVisible(true); + Wallet wallet = headersForm.getWalletTransaction().getWallet(); + Map> signedKeystores = wallet.getSignedKeystores(blockTransaction.getTransaction()); + StringJoiner joiner = new StringJoiner(", "); + signedKeystores.values().stream().flatMap(map -> map.values().stream()).distinct().forEach(keystore -> joiner.add(keystore.getLabel())); + signedBy.setText(joiner.toString()); + } else { + signedByField.setVisible(false); + } } private void initializeSignButton(Wallet signingWallet) { @@ -1478,6 +1499,7 @@ public class HeadersController extends TransactionFormController implements Init errorGlyph.getStyleClass().add("failure"); blockHeightField.setVisible(false); blockTimestampField.setVisible(false); + signedByField.setVisible(false); } } diff --git a/src/main/resources/com/sparrowwallet/sparrow/darktheme.css b/src/main/resources/com/sparrowwallet/sparrow/darktheme.css index bc8b8fa6..c22f165f 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/darktheme.css +++ b/src/main/resources/com/sparrowwallet/sparrow/darktheme.css @@ -329,6 +329,10 @@ HorizontalHeaderColumn > TableColumnHeader.column-header.table-column{ -fx-stroke: #696c77; } +#blockchainForm #blockStatus { + -fx-text-fill: white; +} + .root .progress-indicator.progress-timer.warn > .determinate-indicator > .indicator { -fx-background-color: -fx-box-border, radial-gradient(center 50% 50%, radius 50%, #e06c75 70%, derive(-fx-control-inner-background, -9%) 100%); } diff --git a/src/main/resources/com/sparrowwallet/sparrow/transaction/headers.fxml b/src/main/resources/com/sparrowwallet/sparrow/transaction/headers.fxml index 7d046a5d..5a56f72a 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/transaction/headers.fxml +++ b/src/main/resources/com/sparrowwallet/sparrow/transaction/headers.fxml @@ -196,6 +196,9 @@ + + +