Skip to content

Commit

Permalink
Merge pull request #908 from orogvany/check_wallet_lock
Browse files Browse the repository at this point in the history
GUI: check if wallet unlocked before updating send
  • Loading branch information
semux authored May 25, 2018
2 parents efd2e9d + b0dc5c6 commit 73852f9
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 73852f9

Please sign in to comment.