mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2025-01-27 10:51:09 +00:00
skip labelled addresses when retrieving an unused address from the receive tab and send tab pay to wallet
This commit is contained in:
parent
617ad380c0
commit
2d3bf0b2fe
2 changed files with 4 additions and 1 deletions
|
@ -177,7 +177,7 @@ public class PaymentController extends WalletFormController implements Initializ
|
||||||
List<Address> existingAddresses = getOtherAddresses();
|
List<Address> existingAddresses = getOtherAddresses();
|
||||||
WalletNode freshNode = newValue.getFreshNode(KeyPurpose.RECEIVE);
|
WalletNode freshNode = newValue.getFreshNode(KeyPurpose.RECEIVE);
|
||||||
Address freshAddress = freshNode.getAddress();
|
Address freshAddress = freshNode.getAddress();
|
||||||
while(existingAddresses.contains(freshAddress)) {
|
while(existingAddresses.contains(freshAddress) || (freshNode.getLabel() != null && !freshNode.getLabel().isEmpty())) {
|
||||||
freshNode = newValue.getFreshNode(KeyPurpose.RECEIVE, freshNode);
|
freshNode = newValue.getFreshNode(KeyPurpose.RECEIVE, freshNode);
|
||||||
freshAddress = freshNode.getAddress();
|
freshAddress = freshNode.getAddress();
|
||||||
}
|
}
|
||||||
|
|
|
@ -199,6 +199,9 @@ public class ReceiveController extends WalletFormController implements Initializ
|
||||||
|
|
||||||
public void refreshAddress() {
|
public void refreshAddress() {
|
||||||
NodeEntry freshEntry = getWalletForm().getFreshNodeEntry(KeyPurpose.RECEIVE, currentEntry);
|
NodeEntry freshEntry = getWalletForm().getFreshNodeEntry(KeyPurpose.RECEIVE, currentEntry);
|
||||||
|
while(freshEntry.getLabel() != null && !freshEntry.getLabel().isEmpty()) {
|
||||||
|
freshEntry = getWalletForm().getFreshNodeEntry(KeyPurpose.RECEIVE, freshEntry);
|
||||||
|
}
|
||||||
setNodeEntry(freshEntry);
|
setNodeEntry(freshEntry);
|
||||||
if(addressQrDialog != null) {
|
if(addressQrDialog != null) {
|
||||||
addressQrDialog.close();
|
addressQrDialog.close();
|
||||||
|
|
Loading…
Reference in a new issue