fix case insensitive matching on address and txo entries

This commit is contained in:
Craig Raw 2022-07-21 10:16:49 +02:00
parent b621cac18d
commit 7dae9496ba

View file

@ -170,7 +170,7 @@ public class SearchWalletDialog extends Dialog<Entry> {
NodeEntry purposeEntry = walletForm.getNodeEntry(keyPurpose); NodeEntry purposeEntry = walletForm.getNodeEntry(keyPurpose);
for(Entry entry : purposeEntry.getChildren()) { for(Entry entry : purposeEntry.getChildren()) {
if(entry instanceof NodeEntry nodeEntry) { if(entry instanceof NodeEntry nodeEntry) {
if(nodeEntry.getAddress().toString().contains(searchText) || if(nodeEntry.getAddress().toString().toLowerCase().contains(searchText) ||
(nodeEntry.getLabel() != null && nodeEntry.getLabel().toLowerCase().contains(searchText)) || (nodeEntry.getLabel() != null && nodeEntry.getLabel().toLowerCase().contains(searchText)) ||
(nodeEntry.getValue() != null && searchValue != null && Math.abs(nodeEntry.getValue()) == searchValue)) { (nodeEntry.getValue() != null && searchValue != null && Math.abs(nodeEntry.getValue()) == searchValue)) {
matchingEntries.add(entry); matchingEntries.add(entry);
@ -184,7 +184,7 @@ public class SearchWalletDialog extends Dialog<Entry> {
NodeEntry purposeEntry = nestedWalletForm.getNodeEntry(keyPurpose); NodeEntry purposeEntry = nestedWalletForm.getNodeEntry(keyPurpose);
for(Entry entry : purposeEntry.getChildren()) { for(Entry entry : purposeEntry.getChildren()) {
if(entry instanceof NodeEntry nodeEntry) { if(entry instanceof NodeEntry nodeEntry) {
if(nodeEntry.getAddress().toString().contains(searchText) || if(nodeEntry.getAddress().toString().toLowerCase().contains(searchText) ||
(nodeEntry.getLabel() != null && nodeEntry.getLabel().toLowerCase().contains(searchText)) || (nodeEntry.getLabel() != null && nodeEntry.getLabel().toLowerCase().contains(searchText)) ||
(nodeEntry.getValue() != null && searchValue != null && Math.abs(nodeEntry.getValue()) == searchValue)) { (nodeEntry.getValue() != null && searchValue != null && Math.abs(nodeEntry.getValue()) == searchValue)) {
matchingEntries.add(entry); matchingEntries.add(entry);
@ -197,7 +197,7 @@ public class SearchWalletDialog extends Dialog<Entry> {
WalletUtxosEntry walletUtxosEntry = walletForm.getWalletUtxosEntry(); WalletUtxosEntry walletUtxosEntry = walletForm.getWalletUtxosEntry();
for(Entry entry : walletUtxosEntry.getChildren()) { for(Entry entry : walletUtxosEntry.getChildren()) {
if(entry instanceof HashIndexEntry hashIndexEntry) { if(entry instanceof HashIndexEntry hashIndexEntry) {
if(hashIndexEntry.getBlockTransaction().getHash().toString().equals(searchText) || if(hashIndexEntry.getBlockTransaction().getHash().toString().toLowerCase().equals(searchText) ||
(hashIndexEntry.getLabel() != null && hashIndexEntry.getLabel().toLowerCase().contains(searchText)) || (hashIndexEntry.getLabel() != null && hashIndexEntry.getLabel().toLowerCase().contains(searchText)) ||
(hashIndexEntry.getValue() != null && searchValue != null && Math.abs(hashIndexEntry.getValue()) == searchValue)) { (hashIndexEntry.getValue() != null && searchValue != null && Math.abs(hashIndexEntry.getValue()) == searchValue)) {
matchingEntries.add(entry); matchingEntries.add(entry);