From 9618c73c50e59035cd373d932970f446032cd9e5 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Mon, 31 Jan 2022 19:12:36 +0200 Subject: [PATCH] allow short wallet display name retrieval --- src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java b/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java index a26f43a..06f5c8e 100644 --- a/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java +++ b/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java @@ -73,7 +73,7 @@ public class Wallet extends Persistable implements Comparable { return childWallets.isEmpty() ? name : name + "-" + (label != null && !label.isEmpty() ? label : getAutomaticName()); } - return getMasterWallet().getName() + "-" + getDisplayName(this); + return getMasterWallet().getName() + "-" + getDisplayName(); } public String getFullDisplayName() { @@ -81,11 +81,11 @@ public class Wallet extends Persistable implements Comparable { return childWallets.isEmpty() ? name : name + " - " + (label != null && !label.isEmpty() ? label : getAutomaticName()); } - return getMasterWallet().getName() + " - " + getDisplayName(this); + return getMasterWallet().getName() + " - " + getDisplayName(); } - private String getDisplayName(Wallet wallet) { - return wallet.label != null && !wallet.label.isEmpty() ? wallet.label : wallet.name; + public String getDisplayName() { + return label != null && !label.isEmpty() ? label : (isMasterWallet() ? getAutomaticName() : name); } public String getAutomaticName() {