Skip to content

Commit 4ab9a9f

Browse files
committed
followup tweaks
1 parent c078aea commit 4ab9a9f

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

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

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

230-
if(!isFinal() && walletTx.getPayments().size() > 1) {
231-
Pane totalsPane = getTotalsPane();
230+
List<Payment> defaultPayments = getDefaultPayments();
231+
if(!isFinal() && defaultPayments.size() > 1) {
232+
Pane totalsPane = getTotalsPane(defaultPayments);
232233
GridPane.setConstraints(totalsPane, 2, 0, 3, 1);
233234
getChildren().add(totalsPane);
234235
}
@@ -620,6 +621,10 @@ private List<Payment> getDisplayedPayments() {
620621
}
621622
}
622623

624+
private List<Payment> getDefaultPayments() {
625+
return walletTx.getPayments().stream().filter(payment -> payment.getType() == Payment.Type.DEFAULT).toList();
626+
}
627+
623628
private Pane getOutputsLines(List<Payment> displayedPayments) {
624629
VBox pane = new VBox();
625630
Group group = new Group();
@@ -843,19 +848,18 @@ private Pane getTransactionPane() {
843848
return txPane;
844849
}
845850

846-
private Pane getTotalsPane() {
851+
private Pane getTotalsPane(List<Payment> defaultPayments) {
847852
VBox totalsBox = new VBox();
848853
totalsBox.setPadding(new Insets(0, 0, 15, 0));
849854
totalsBox.setAlignment(Pos.CENTER);
850855

851-
long amount = walletTx.getPayments().stream().mapToLong(Payment::getAmount).sum();
852-
long count = walletTx.getPayments().size();
856+
long amount = defaultPayments.stream().mapToLong(Payment::getAmount).sum();
853857

854858
HBox coinLabelBox = new HBox();
855859
coinLabelBox.setAlignment(Pos.CENTER);
856860
CoinLabel totalCoinLabel = new CoinLabel();
857861
totalCoinLabel.setValue(amount);
858-
coinLabelBox.getChildren().addAll(totalCoinLabel, new Label(" in "), new Label(Long.toString(count)), new Label(" payments"));
862+
coinLabelBox.getChildren().addAll(totalCoinLabel, new Label(" in "), new Label(Long.toString(defaultPayments.size())), new Label(" payments"));
859863
totalsBox.getChildren().addAll(createSpacer(), coinLabelBox);
860864

861865
CurrencyRate currencyRate = AppServices.getFiatCurrencyExchangeRate();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,7 @@ public PrivacyAnalysisTooltip(WalletTransaction walletTransaction) {
16251625
} else if(payjoinPresent) {
16261626
addLabel("Cannot fake coinjoin due to payjoin", getInfoGlyph());
16271627
} else {
1628-
if(utxoSelectorProperty().get() != null) {
1628+
if(utxoSelectorProperty().get() != null && !(utxoSelectorProperty().get() instanceof MaxUtxoSelector)) {
16291629
addLabel("Cannot fake coinjoin due to coin control", getInfoGlyph());
16301630
} else {
16311631
addLabel("Cannot fake coinjoin due to insufficient funds", getInfoGlyph());

0 commit comments

Comments
 (0)