diff --git a/drongo b/drongo index 64017615..fe57ad3e 160000 --- a/drongo +++ b/drongo @@ -1 +1 @@ -Subproject commit 640176153016e6b38b367d6d7e37ecf15cfee745 +Subproject commit fe57ad3e7a16fac968910f6581075fdbd79e10a8 diff --git a/src/main/java/com/sparrowwallet/sparrow/net/ElectrumServer.java b/src/main/java/com/sparrowwallet/sparrow/net/ElectrumServer.java index 18d1ca3e..8444c70e 100644 --- a/src/main/java/com/sparrowwallet/sparrow/net/ElectrumServer.java +++ b/src/main/java/com/sparrowwallet/sparrow/net/ElectrumServer.java @@ -1717,12 +1717,8 @@ public class ElectrumServer { PayNym payNym = Config.get().isUsePayNym() ? getPayNym(paymentCode) : null; List scriptTypes = payNym == null || wallet.getScriptType() != ScriptType.P2PKH ? PayNym.getSegwitScriptTypes() : payNym.getScriptTypes(); for(ScriptType childScriptType : scriptTypes) { - Wallet addedWallet = wallet.addChildWallet(paymentCode, childScriptType, output, blkTx); - if(payNym != null) { - addedWallet.setLabel(payNym.nymName() + " " + childScriptType.getName()); - } else { - addedWallet.setLabel(paymentCode.toAbbreviatedString() + " " + childScriptType.getName()); - } + String label = (payNym == null ? paymentCode.toAbbreviatedString() : payNym.nymName()) + " " + childScriptType.getName(); + Wallet addedWallet = wallet.addChildWallet(paymentCode, childScriptType, output, blkTx, label); //Check this is a valid payment code, will throw IllegalArgumentException if not try { WalletNode receiveNode = new WalletNode(addedWallet, KeyPurpose.RECEIVE, 0); diff --git a/src/main/java/com/sparrowwallet/sparrow/paynym/PayNymController.java b/src/main/java/com/sparrowwallet/sparrow/paynym/PayNymController.java index 98657a2c..74d78116 100644 --- a/src/main/java/com/sparrowwallet/sparrow/paynym/PayNymController.java +++ b/src/main/java/com/sparrowwallet/sparrow/paynym/PayNymController.java @@ -421,8 +421,8 @@ public class PayNymController { Storage storage = AppServices.get().getOpenWallets().get(masterWallet); List scriptTypes = masterWallet.getScriptType() != ScriptType.P2PKH ? PayNym.getSegwitScriptTypes() : payNym.getScriptTypes(); for(ScriptType childScriptType : scriptTypes) { - Wallet addedWallet = masterWallet.addChildWallet(externalPaymentCode, childScriptType); - addedWallet.setLabel(payNym.nymName() + " " + childScriptType.getName()); + String label = payNym.nymName() + " " + childScriptType.getName(); + Wallet addedWallet = masterWallet.addChildWallet(externalPaymentCode, childScriptType, label); if(!storage.isPersisted(addedWallet)) { try { storage.saveWallet(addedWallet); diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java index fe85ad81..87959cdb 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java @@ -1349,8 +1349,8 @@ public class SendController extends WalletFormController implements Initializabl Storage storage = AppServices.get().getOpenWallets().get(masterWallet); List scriptTypes = PayNym.getSegwitScriptTypes(); for(ScriptType childScriptType : scriptTypes) { - Wallet addedWallet = masterWallet.addChildWallet(externalPaymentCode, childScriptType); - addedWallet.setLabel((payNym == null ? externalPaymentCode.toAbbreviatedString() : payNym.nymName()) + " " + childScriptType.getName()); + String label = (payNym == null ? externalPaymentCode.toAbbreviatedString() : payNym.nymName()) + " " + childScriptType.getName(); + Wallet addedWallet = masterWallet.addChildWallet(externalPaymentCode, childScriptType, label); if(!storage.isPersisted(addedWallet)) { try { storage.saveWallet(addedWallet);