Fix bug where updating would stop once coins were sent

This commit is contained in:
pokkst 2022-09-22 20:35:25 -05:00
parent 693b342393
commit 9187b9d8a4
No known key found for this signature in database
GPG Key ID: 90C2ED85E67A50FF
2 changed files with 10 additions and 6 deletions

View File

@ -349,8 +349,10 @@ public class Wallet {
}
public void refreshCoins() {
if(this.isSynchronized()) {
getCoins().refresh();
}
}
private native long setListenerJ(WalletListener listener);

View File

@ -86,13 +86,13 @@ public class MoneroHandlerThread extends Thread implements WalletListener {
@Override
public void newBlock(long height) {
refresh();
refresh(false);
BlockchainService.getInstance().setDaemonHeight(wallet.isSynchronized() ? height : 0);
}
@Override
public void updated() {
refresh();
refresh(false);
}
@Override
@ -109,15 +109,17 @@ public class MoneroHandlerThread extends Thread implements WalletListener {
BlockchainService.getInstance().setDaemonHeight(wallet.getDaemonBlockChainHeight());
wallet.setSynchronized();
wallet.store();
refresh();
refresh(true);
}
BlockchainService.getInstance().setConnectionStatus(status);
}
private void refresh() {
private void refresh(boolean refreshCoins) {
wallet.refreshHistory();
if(refreshCoins) {
wallet.refreshCoins();
}
listener.onRefresh();
}