Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: DickonManwoody on May 04, 2019, 01:35:14 AM



Title: Bitcoinj Importing Private Keys
Post by: DickonManwoody on May 04, 2019, 01:35:14 AM

I imported the private keys into my wallet and they appear to be added: This is the result when i run getImportedKeys():
Code:
[ECKey{pub HEX=022249de1a0fb3c72fe9284ca449477ef1b0e43dc4245d3137d7d7a57f697f8d1d, isEncrypted=false, isPubKeyOnly=false}, ECKey{pub HEX=039ad0a1c1f63b3d5db4eab32401396f0dae98935825e99381cd3a630092ef1e0f, isEncrypted=false, isPubKeyOnly=false}, ... etc
I resynced the wallet, but the transactions associated with this keys are not showing up.

From my understanding it can deduce the public keys from the private keys, and look up the transactions associated with those keys. Im using WalletAppKit to create the wallet, everything works okey, the wallet is functional. This is how i initialize the wallet:
Code:
    MainContext = context;
    coinreceived = MediaPlayer.create(MainContext, R.raw.received);
    coinsent=MediaPlayer.create(MainContext, R.raw.sent);
    kit = new WalletAppKit(netParams, new File(String.valueOf(context.getFilesDir()+ File.separator + walletFolder))  , "walletappkit-example");

    kit.setDownloadListener(listener);
    kit.setBlockingStartup(false);
    kit.startAsync();

    saveWalletAddress();
Any ideas on how can i solve this? Thanks in advance.