Skip to content

Commit db478f8

Browse files
committed
further followup tweaks
1 parent 4ab9a9f commit db478f8

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/main/java/com/sparrowwallet/sparrow/control/TransactionDiagram.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,9 @@ public void update() {
227227
getChildren().clear();
228228
getChildren().addAll(inputsTypePane, inputsPane, inputsLinesPane, txPane, outputsLinesPane, outputsPane);
229229

230-
List<Payment> defaultPayments = getDefaultPayments();
231-
if(!isFinal() && defaultPayments.size() > 1) {
232-
Pane totalsPane = getTotalsPane(defaultPayments);
230+
List<Payment> userPayments = getUserPayments();
231+
if(!isFinal() && userPayments.size() > 1) {
232+
Pane totalsPane = getTotalsPane(userPayments);
233233
GridPane.setConstraints(totalsPane, 2, 0, 3, 1);
234234
getChildren().add(totalsPane);
235235
}
@@ -621,8 +621,8 @@ private List<Payment> getDisplayedPayments() {
621621
}
622622
}
623623

624-
private List<Payment> getDefaultPayments() {
625-
return walletTx.getPayments().stream().filter(payment -> payment.getType() == Payment.Type.DEFAULT).toList();
624+
private List<Payment> getUserPayments() {
625+
return walletTx.getPayments().stream().filter(payment -> payment.getType() == Payment.Type.DEFAULT || payment.getType() == Payment.Type.ANCHOR).toList();
626626
}
627627

628628
private Pane getOutputsLines(List<Payment> displayedPayments) {
@@ -848,18 +848,18 @@ private Pane getTransactionPane() {
848848
return txPane;
849849
}
850850

851-
private Pane getTotalsPane(List<Payment> defaultPayments) {
851+
private Pane getTotalsPane(List<Payment> userPayments) {
852852
VBox totalsBox = new VBox();
853853
totalsBox.setPadding(new Insets(0, 0, 15, 0));
854854
totalsBox.setAlignment(Pos.CENTER);
855855

856-
long amount = defaultPayments.stream().mapToLong(Payment::getAmount).sum();
856+
long amount = userPayments.stream().mapToLong(Payment::getAmount).sum();
857857

858858
HBox coinLabelBox = new HBox();
859859
coinLabelBox.setAlignment(Pos.CENTER);
860860
CoinLabel totalCoinLabel = new CoinLabel();
861861
totalCoinLabel.setValue(amount);
862-
coinLabelBox.getChildren().addAll(totalCoinLabel, new Label(" in "), new Label(Long.toString(defaultPayments.size())), new Label(" payments"));
862+
coinLabelBox.getChildren().addAll(totalCoinLabel, new Label(" in "), new Label(Long.toString(userPayments.size())), new Label(" payments"));
863863
totalsBox.getChildren().addAll(createSpacer(), coinLabelBox);
864864

865865
CurrencyRate currencyRate = AppServices.getFiatCurrencyExchangeRate();

src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,9 @@ public PrivacyAnalysisTooltip(WalletTransaction walletTransaction) {
16251625
} else if(payjoinPresent) {
16261626
addLabel("Cannot fake coinjoin due to payjoin", getInfoGlyph());
16271627
} else {
1628-
if(utxoSelectorProperty().get() != null && !(utxoSelectorProperty().get() instanceof MaxUtxoSelector)) {
1628+
if(utxoSelectorProperty().get() instanceof MaxUtxoSelector) {
1629+
addLabel("Cannot fake coinjoin with max amount selected", getInfoGlyph());
1630+
} else if(utxoSelectorProperty().get() != null) {
16291631
addLabel("Cannot fake coinjoin due to coin control", getInfoGlyph());
16301632
} else {
16311633
addLabel("Cannot fake coinjoin due to insufficient funds", getInfoGlyph());

0 commit comments

Comments
 (0)