I'm trying to restore another wallet by replacing one created already.
// First step to delete wallet file already exists
File file = new File(directory, prefix + ".wallet"); // Wallet file path
if (!file.delete()) {
// Throw an exception
}
// Second step to delete blockchain file which already synced
File file = new File(directory, prefix + ".chain"); // Blockchain file path
if (!file.delete()) {
// Throw an exception
}
// Third step to restore another wallet from the seed
final DeterministicSeed newSeed = new DeterministicSeed(paperKeys, null, "",
TIMESTAMP_SINCE_JANUARY_FIRST_2018);
final Wallet wallet = Wallet.fromSeed(networkParams, newSeed);
So the question is do we always need second step to restore the wallet
properly?
I don't see the balance recovered (it's zero) when omitting second step
even though that wallet was filled with some amount before.
If I do the second step, it's working properly but it takes another longer
time (up to 30 minutes) to do syncing blockchains via peer group, which I
don't think needed if re-use the old blockchains.
Is it right to always re-sync the blockchain or is there any workaround for
it? (like to rescan the blockchains to get the balance back?)
--
You received this message because you are subscribed to the Google Groups
"bitcoinj" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.