Skip to content

Commit

Permalink
GUI: check if wallet unlocked before updating send
Browse files Browse the repository at this point in the history
Avoid logspam with attempting to read from wallet for rending address
book.

fixes #907
  • Loading branch information
orogvany committed May 25, 2018
1 parent f3682f4 commit b0dc5c6
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/main/java/org/semux/gui/panel/SendPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -336,17 +336,18 @@ protected void refresh() {
}
}

// add aliases to list of accounts
for (Map.Entry<ByteArray, String> address : kernel.getWallet().getAddressAliases().entrySet()) {
// only add aliases not in wallet
if (kernel.getWallet().getAccount(address.getKey().getData()) == null) {
accountItems.add(new AccountItem(address.getValue(), address.getKey().getData()));
// 'to' contains all current accounts and address book, only update if user
// isn't interacting with it, and wallet is unlocked
if (!selectTo.isPopupVisible() && kernel.getWallet().isUnlocked()) {

// add aliases to list of accounts
for (Map.Entry<ByteArray, String> address : kernel.getWallet().getAddressAliases().entrySet()) {
// only add aliases not in wallet
if (kernel.getWallet().getAccount(address.getKey().getData()) == null) {
accountItems.add(new AccountItem(address.getValue(), address.getKey().getData()));
}
}
}

// 'to' contains all current accounts and address book, only update if user
// isn't interacting with it
if (!selectTo.isPopupVisible()) {
Object toSelected = selectTo.getSelectedItem();

selectTo.removeAllItems();
Expand Down

0 comments on commit b0dc5c6

Please sign in to comment.