@@ -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 ();
0 commit comments