|
|
|
@ -18,6 +18,7 @@ package com.m2049r.xmrwallet.model;
|
|
|
|
|
|
|
|
|
|
import com.m2049r.xmrwallet.data.WalletNode;
|
|
|
|
|
import com.m2049r.xmrwallet.ledger.Ledger;
|
|
|
|
|
import com.m2049r.xmrwallet.util.RestoreHeight;
|
|
|
|
|
|
|
|
|
|
import java.io.BufferedReader;
|
|
|
|
|
import java.io.File;
|
|
|
|
@ -25,6 +26,7 @@ import java.io.FileReader;
|
|
|
|
|
import java.io.FilenameFilter;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
import timber.log.Timber;
|
|
|
|
@ -76,6 +78,13 @@ public class WalletManager {
|
|
|
|
|
long walletHandle = createWalletJ(aFile.getAbsolutePath(), password, language, getNetworkType().getValue());
|
|
|
|
|
Wallet wallet = new Wallet(walletHandle);
|
|
|
|
|
manageWallet(wallet);
|
|
|
|
|
if (wallet.getStatus() == Wallet.Status.Status_Ok) {
|
|
|
|
|
// (Re-)Estimate restore height based on what we know
|
|
|
|
|
long oldHeight = wallet.getRestoreHeight();
|
|
|
|
|
wallet.setRestoreHeight(RestoreHeight.getInstance().getHeight(new Date()));
|
|
|
|
|
Timber.d("Changed Restore Height from %d to %d", oldHeight, wallet.getRestoreHeight());
|
|
|
|
|
wallet.setPassword(password); // this rewrites the keys file (which contains the restore height)
|
|
|
|
|
}
|
|
|
|
|
return wallet;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|