mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-05 05:46:44 +00:00
set bip47 wallet label before creating addresses
This commit is contained in:
parent
04cb27f85e
commit
95d8201bd9
4 changed files with 7 additions and 11 deletions
2
drongo
2
drongo
|
@ -1 +1 @@
|
||||||
Subproject commit 640176153016e6b38b367d6d7e37ecf15cfee745
|
Subproject commit fe57ad3e7a16fac968910f6581075fdbd79e10a8
|
|
@ -1717,12 +1717,8 @@ public class ElectrumServer {
|
||||||
PayNym payNym = Config.get().isUsePayNym() ? getPayNym(paymentCode) : null;
|
PayNym payNym = Config.get().isUsePayNym() ? getPayNym(paymentCode) : null;
|
||||||
List<ScriptType> scriptTypes = payNym == null || wallet.getScriptType() != ScriptType.P2PKH ? PayNym.getSegwitScriptTypes() : payNym.getScriptTypes();
|
List<ScriptType> scriptTypes = payNym == null || wallet.getScriptType() != ScriptType.P2PKH ? PayNym.getSegwitScriptTypes() : payNym.getScriptTypes();
|
||||||
for(ScriptType childScriptType : scriptTypes) {
|
for(ScriptType childScriptType : scriptTypes) {
|
||||||
Wallet addedWallet = wallet.addChildWallet(paymentCode, childScriptType, output, blkTx);
|
String label = (payNym == null ? paymentCode.toAbbreviatedString() : payNym.nymName()) + " " + childScriptType.getName();
|
||||||
if(payNym != null) {
|
Wallet addedWallet = wallet.addChildWallet(paymentCode, childScriptType, output, blkTx, label);
|
||||||
addedWallet.setLabel(payNym.nymName() + " " + childScriptType.getName());
|
|
||||||
} else {
|
|
||||||
addedWallet.setLabel(paymentCode.toAbbreviatedString() + " " + childScriptType.getName());
|
|
||||||
}
|
|
||||||
//Check this is a valid payment code, will throw IllegalArgumentException if not
|
//Check this is a valid payment code, will throw IllegalArgumentException if not
|
||||||
try {
|
try {
|
||||||
WalletNode receiveNode = new WalletNode(addedWallet, KeyPurpose.RECEIVE, 0);
|
WalletNode receiveNode = new WalletNode(addedWallet, KeyPurpose.RECEIVE, 0);
|
||||||
|
|
|
@ -421,8 +421,8 @@ public class PayNymController {
|
||||||
Storage storage = AppServices.get().getOpenWallets().get(masterWallet);
|
Storage storage = AppServices.get().getOpenWallets().get(masterWallet);
|
||||||
List<ScriptType> scriptTypes = masterWallet.getScriptType() != ScriptType.P2PKH ? PayNym.getSegwitScriptTypes() : payNym.getScriptTypes();
|
List<ScriptType> scriptTypes = masterWallet.getScriptType() != ScriptType.P2PKH ? PayNym.getSegwitScriptTypes() : payNym.getScriptTypes();
|
||||||
for(ScriptType childScriptType : scriptTypes) {
|
for(ScriptType childScriptType : scriptTypes) {
|
||||||
Wallet addedWallet = masterWallet.addChildWallet(externalPaymentCode, childScriptType);
|
String label = payNym.nymName() + " " + childScriptType.getName();
|
||||||
addedWallet.setLabel(payNym.nymName() + " " + childScriptType.getName());
|
Wallet addedWallet = masterWallet.addChildWallet(externalPaymentCode, childScriptType, label);
|
||||||
if(!storage.isPersisted(addedWallet)) {
|
if(!storage.isPersisted(addedWallet)) {
|
||||||
try {
|
try {
|
||||||
storage.saveWallet(addedWallet);
|
storage.saveWallet(addedWallet);
|
||||||
|
|
|
@ -1349,8 +1349,8 @@ public class SendController extends WalletFormController implements Initializabl
|
||||||
Storage storage = AppServices.get().getOpenWallets().get(masterWallet);
|
Storage storage = AppServices.get().getOpenWallets().get(masterWallet);
|
||||||
List<ScriptType> scriptTypes = PayNym.getSegwitScriptTypes();
|
List<ScriptType> scriptTypes = PayNym.getSegwitScriptTypes();
|
||||||
for(ScriptType childScriptType : scriptTypes) {
|
for(ScriptType childScriptType : scriptTypes) {
|
||||||
Wallet addedWallet = masterWallet.addChildWallet(externalPaymentCode, childScriptType);
|
String label = (payNym == null ? externalPaymentCode.toAbbreviatedString() : payNym.nymName()) + " " + childScriptType.getName();
|
||||||
addedWallet.setLabel((payNym == null ? externalPaymentCode.toAbbreviatedString() : payNym.nymName()) + " " + childScriptType.getName());
|
Wallet addedWallet = masterWallet.addChildWallet(externalPaymentCode, childScriptType, label);
|
||||||
if(!storage.isPersisted(addedWallet)) {
|
if(!storage.isPersisted(addedWallet)) {
|
||||||
try {
|
try {
|
||||||
storage.saveWallet(addedWallet);
|
storage.saveWallet(addedWallet);
|
||||||
|
|
Loading…
Reference in a new issue