mirror of
https://codeberg.org/r4v3r23/mysu.git
synced 2024-11-23 06:12:26 +00:00
Fix bug where updating would stop once coins were sent
This commit is contained in:
parent
693b342393
commit
9187b9d8a4
2 changed files with 10 additions and 6 deletions
|
@ -349,7 +349,9 @@ public class Wallet {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void refreshCoins() {
|
public void refreshCoins() {
|
||||||
getCoins().refresh();
|
if(this.isSynchronized()) {
|
||||||
|
getCoins().refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private native long setListenerJ(WalletListener listener);
|
private native long setListenerJ(WalletListener listener);
|
||||||
|
|
|
@ -86,13 +86,13 @@ public class MoneroHandlerThread extends Thread implements WalletListener {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void newBlock(long height) {
|
public void newBlock(long height) {
|
||||||
refresh();
|
refresh(false);
|
||||||
BlockchainService.getInstance().setDaemonHeight(wallet.isSynchronized() ? height : 0);
|
BlockchainService.getInstance().setDaemonHeight(wallet.isSynchronized() ? height : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updated() {
|
public void updated() {
|
||||||
refresh();
|
refresh(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -109,15 +109,17 @@ public class MoneroHandlerThread extends Thread implements WalletListener {
|
||||||
BlockchainService.getInstance().setDaemonHeight(wallet.getDaemonBlockChainHeight());
|
BlockchainService.getInstance().setDaemonHeight(wallet.getDaemonBlockChainHeight());
|
||||||
wallet.setSynchronized();
|
wallet.setSynchronized();
|
||||||
wallet.store();
|
wallet.store();
|
||||||
refresh();
|
refresh(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
BlockchainService.getInstance().setConnectionStatus(status);
|
BlockchainService.getInstance().setConnectionStatus(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void refresh() {
|
private void refresh(boolean refreshCoins) {
|
||||||
wallet.refreshHistory();
|
wallet.refreshHistory();
|
||||||
wallet.refreshCoins();
|
if(refreshCoins) {
|
||||||
|
wallet.refreshCoins();
|
||||||
|
}
|
||||||
listener.onRefresh();
|
listener.onRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue