Have you looked at the RestoreFromSeed code example? It does exactly that.
On 05/07/2017 01:39 AM, Bruno Martins wrote:
> Hey,
>
> I've started a Bitcoin wallet pet project to start getting familiarized
> with crypto / blockchain development.
>
> I am having trouble recovering a wallet from the mnemonic seed and it's
> creation date.
>
> After the attempting to sync i end up with a total new wallet but with
> the old (previous wallet) mnemonic seed attached to it . I'm a bit confused.
>
> |
> finalDeterministicSeedseed =createDeterministicSeed();
>
>
> _bitcoinManager.getCurrencyCoin().getWalletManager().addListener(newService.Listener(){
> @Override
> publicvoidterminated(Service.Statefrom){
> super.terminated(from);
> WalletAppKitappKit =setupWallet();
>
> appKit.setDownloadListener(BitcoinRecoverAction.this)
> .setBlockingStartup(false)
> .setUserAgent(ServiceConsts.SERVICE_APP_NAME,"0.1")
> .restoreWalletFromSeed(seed);
>
> _bitcoinManager.getCurrencyCoin().setWalletManager(appKit);
>
> _bitcoinManager.getCurrencyCoin().getWalletManager().startAsync();
> }
> },Executors.newSingleThreadExecutor());
>
> _bitcoinManager.getCurrencyCoin().getWalletManager().stopAsync();
> |
>
> The entire class / code can be found here :
> https://github.com/ehanoc/xwallet/blob/master/app/src/main/java/com/bytetobyte/xwallet/service/coin/bitcoin/actions/BitcoinRecoverAction.java
>
> Thanks a million
> Bruno
>
> --
> 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.