Getting old address while restoring

by user82708   Last Updated May 04, 2018 08:27 AM

Long CreationTimeSeconds = Pref.getValue(activity, Config.PREF_CreationTimeSeconds, System.currentTimeMillis());
                List<String> strlist = UtilsFunctions.getMnemoniWordlist(activity);
                DeterministicSeed deterministicKey = new DeterministicSeed(MnemonicCode.toSeed(strlist, ""), strlist, CreationTimeSeconds);
                KeyChainGroup keyChainGroup = new KeyChainGroup(Constants.NETWORK_PARAMETERS, deterministicKey);
                Wallet wallet = new Wallet(Constants.NETWORK_PARAMETERS, keyChainGroup);
                DeterministicSeed deterministicSeedReceiver = wallet.getKeyChainSeed();
                ArrayList<String> mnemoniccodes = (ArrayList<String>) deterministicSeedReceiver.getMnemonicCode();
                android.util.Log.e(WalletFragment.class.getSimpleName(), "Wallet:: " + wallet);
                android.util.Log.e(WalletFragment.class.getSimpleName(), "Wallet Address:: " + wallet.currentReceiveAddress());
                android.util.Log.e(WalletFragment.class.getSimpleName(), "Wallet Balance:: " + wallet.getBalance(Wallet.BalanceType.AVAILABLE));

This is my code for restoring wallet from seed.

When I run this it gave me old initial wallet address but as I send some coins to another at that time this address is changed.

So instead of getting new address at the time of wallet restore, I got initial address.

Please help me with this.

Tags : bitcoinj android

Related Questions

convert 12 word seed into 24 word seed

Updated June 25, 2018 12:27 PM

Restore from 24 words seed

Updated July 26, 2018 12:27 PM

Get Private Keys

Updated September 06, 2018 11:27 AM

Bitcoinj Standard

Updated September 11, 2018 10:27 AM