Improved ensureSynchronized() as it would often not notice an unsynced wallet.

This commit is contained in:
CalDescent 2022-05-30 18:14:26 +02:00
parent 5203742b05
commit c30b1145a1

View File

@ -170,6 +170,10 @@ public class PirateChainWalletController extends Thread {
}
public void ensureSynchronized() throws ForeignBlockchainException {
if (this.currentWallet == null || !this.currentWallet.isSynchronized()) {
throw new ForeignBlockchainException("Wallet isn't synchronized yet");
}
String response = LiteWalletJni.execute("syncStatus", "");
JSONObject json = new JSONObject(response);
if (json.has("syncing")) {