update state from wallet notifications on UserThread

This commit is contained in:
woodser 2024-01-08 07:07:38 -05:00
parent a6f6f5c00a
commit c28ffb70ff
7 changed files with 93 additions and 100 deletions

View file

@ -1297,12 +1297,16 @@ public class XmrWalletService {
}
public void addWalletListener(MoneroWalletListenerI listener) {
walletListeners.add(listener);
synchronized (walletListeners) {
walletListeners.add(listener);
}
}
public void removeWalletListener(MoneroWalletListenerI listener) {
if (!walletListeners.contains(listener)) throw new RuntimeException("Listener is not registered with wallet");
walletListeners.remove(listener);
synchronized (walletListeners) {
if (!walletListeners.contains(listener)) throw new RuntimeException("Listener is not registered with wallet");
walletListeners.remove(listener);
}
}
// TODO (woodser): update balance and other listening