Bitcoinj doesn't keep the full blockchain like a full node would do, so
you need to re-sync. You could run your own bitcoind and sync against
that for maximum performance though.
On 05/18/2018 06:24 PM, Pei wrote:
> I'm trying to restore another wallet by replacing one created already.
>
> |
> // First step to delete wallet file already exists
> Filefile =newFile(directory,prefix +".wallet");// Wallet file path
> if(!file.delete()){
> // Throw an exception
> }
>
>
> // Second step to delete blockchain file which already synced
> Filefile =newFile(directory,prefix +".chain");// Blockchain file path
> if(!file.delete()){
> // Throw an exception
> }
>
>
> // Third step to restore another wallet from the seed
> finalDeterministicSeednewSeed =newDeterministicSeed(paperKeys,null,"",
> TIMESTAMP_SINCE_JANUARY_FIRST_2018);
> finalWalletwallet =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]
> <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout.
--
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.