skip labelled addresses when retrieving an unused address from the receive tab and send tab pay to wallet

This commit is contained in:
Craig Raw 2025-01-16 12:18:12 +02:00
parent 617ad380c0
commit 2d3bf0b2fe
2 changed files with 4 additions and 1 deletions

View file

@ -177,7 +177,7 @@ public class PaymentController extends WalletFormController implements Initializ
List<Address> existingAddresses = getOtherAddresses();
WalletNode freshNode = newValue.getFreshNode(KeyPurpose.RECEIVE);
Address freshAddress = freshNode.getAddress();
while(existingAddresses.contains(freshAddress)) {
while(existingAddresses.contains(freshAddress) || (freshNode.getLabel() != null && !freshNode.getLabel().isEmpty())) {
freshNode = newValue.getFreshNode(KeyPurpose.RECEIVE, freshNode);
freshAddress = freshNode.getAddress();
}

View file

@ -199,6 +199,9 @@ public class ReceiveController extends WalletFormController implements Initializ
public void refreshAddress() {
NodeEntry freshEntry = getWalletForm().getFreshNodeEntry(KeyPurpose.RECEIVE, currentEntry);
while(freshEntry.getLabel() != null && !freshEntry.getLabel().isEmpty()) {
freshEntry = getWalletForm().getFreshNodeEntry(KeyPurpose.RECEIVE, freshEntry);
}
setNodeEntry(freshEntry);
if(addressQrDialog != null) {
addressQrDialog.close();