Bitcoinj wallet can't receive coins in Testnet3

by Ilyam   Last Updated October 05, 2018 14:27 PM

I have a problem with bitcoinj.

I have created a wallet and than trying to send coins to it in Testnet3 using this faucet: https://coinfaucet.eu/en/btc-testnet/

Coins sended, transaction confirmed, but when I trying to get balance - it's always zero (available = available spendable = extimated = estimated spandable = 0).

Here is how I creating a Wallet:

NetworkParameters params = TestNet3Params.get();
Wallet wallet = new Wallet(params);
BlockChain chain = new BlockChain(params, wallet, new MemoryBlockStore(params));
PeerGroup peerGroup = new PeerGroup(params, chain);
peerGroup.addWallet(wallet);
peerGroup.startAsync();
File file = new File("testwallet");
wallet.saveToFile(file);

Address:

wallet.currentReceiveAddress().toString()

Balance:

wallet.getBalance()
wallet.getBalance(Wallet.BalanceType.AVAILABLE_SPENDABLE)
wallet.getBalance(Wallet.BalanceType.AVAILABLE)
wallet.getBalance(Wallet.BalanceType.ESTIMATED_SPENDABLE)
wallet.getBalance(Wallet.BalanceType.ESTIMATED)

And it's always zero.

What I'm doing wrong? Why I can't receive coins?



Related Questions


Can't see balance after some time

Updated September 20, 2018 09:27 AM

How find own address in testnet using bitcoin-cli?

Updated February 15, 2019 08:27 AM


Wallet balance is not updating

Updated June 27, 2017 06:27 AM

How to convert Satoshi to BTC in Java?

Updated July 01, 2017 07:27 AM