diff --git a/src/main/java/com/sparrowwallet/sparrow/transaction/TransactionController.java b/src/main/java/com/sparrowwallet/sparrow/transaction/TransactionController.java index b807d259..b42ec01d 100644 --- a/src/main/java/com/sparrowwallet/sparrow/transaction/TransactionController.java +++ b/src/main/java/com/sparrowwallet/sparrow/transaction/TransactionController.java @@ -244,7 +244,7 @@ public class TransactionController implements Initializable { @Subscribe public void transactionChanged(TransactionChangedEvent event) { - if (event.getTransaction().equals(transaction)) { + if(event.getTransaction().equals(transaction)) { refreshTxHex(); txtree.refresh(); } diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/NodeEntry.java b/src/main/java/com/sparrowwallet/sparrow/wallet/NodeEntry.java index 0e3bb112..73dcca13 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/NodeEntry.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/NodeEntry.java @@ -24,6 +24,14 @@ public class NodeEntry extends Entry { }); } + public Wallet getWallet() { + return wallet; + } + + public WalletNode getNode() { + return node; + } + public Address getAddress() { return wallet.getAddress(node); } @@ -42,8 +50,4 @@ public class NodeEntry extends Entry { return null; } - - public WalletNode getNode() { - return node; - } } diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/ReceiveController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/ReceiveController.java index 5aae3eea..293dabc7 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/ReceiveController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/ReceiveController.java @@ -110,6 +110,8 @@ public class ReceiveController extends WalletFormController implements Initializ @Subscribe public void receiveTo(ReceiveToEvent event) { - setNodeEntry(event.getReceiveEntry()); + if(event.getReceiveEntry().getWallet().equals(getWalletForm().getWallet())) { + setNodeEntry(event.getReceiveEntry()); + } } } diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/WalletController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/WalletController.java index 71849aba..aa90298b 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/WalletController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/WalletController.java @@ -96,11 +96,15 @@ public class WalletController extends WalletFormController implements Initializa @Subscribe public void walletSettingsChanged(WalletSettingsChangedEvent event) { - configure(walletForm.getWallet().isValid()); + if(event.getWalletFile().equals(walletForm.getWalletFile())) { + configure(walletForm.getWallet().isValid()); + } } @Subscribe public void receiveAction(ReceiveActionEvent event) { - selectFunction(Function.RECEIVE); + if(event.getReceiveEntry().getWallet().equals(walletForm.getWallet())) { + selectFunction(Function.RECEIVE); + } } } diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java b/src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java index 3a92eae0..8b7c7eb9 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java @@ -110,11 +110,13 @@ public class WalletForm { @Subscribe public void walletChanged(WalletChangedEvent event) { - try { - save(); - } catch (IOException e) { - //Background save failed - e.printStackTrace(); + if(event.getWallet().equals(wallet)) { + try { + save(); + } catch (IOException e) { + //Background save failed + e.printStackTrace(); + } } } }