Java, Spring, Eclipce, bitcoinj
I'm trying to get the number of satoshi using the private key.
First I get the address
everything prints it fine.
then I try to find out the amount...
NetworkParameters params = MainNetParams.get();
Wallet wallet = new Wallet(params);
BlockStore blockStore = new MemoryBlockStore(params);
BlockChain chain;
try {
chain = new BlockChain(params, wallet, blockStore);
PeerGroup peerGroup = new PeerGroup(params, chain);
peerGroup.addWallet(wallet);
peerGroup.start();
peerGroup.downloadBlockChain ();
model.addAttribute("balance", wallet.getBalance());
hangs tightly.
How to find out the correct amount on the account? I have a synchronized Core / Can I get it out of it somehow?
thank you very much in any your advices
2021-02-28 13:00:00.044 INFO 7496 --- [eerGroup Thread] o.bitcoinj.wallet.DeterministicKeyChain : 133 keys needed for M/0H/0 = 0 issued + 100 lookahead size + 33 lookahead threshold - 0 num children
2021-02-28 13:00:00.145 INFO 7496 --- [eerGroup Thread] o.bitcoinj.wallet.DeterministicKeyChain : Took 101.2 ms
2021-02-28 13:00:00.146 INFO 7496 --- [eerGroup Thread] o.bitcoinj.wallet.DeterministicKeyChain : 133 keys needed for M/0H/1 = 0 issued + 100 lookahead size + 33 lookahead threshold - 0 num children
2021-02-28 13:00:00.235 INFO 7496 --- [eerGroup Thread] o.bitcoinj.wallet.DeterministicKeyChain : Took 88.82 ms
2021-02-28 13:00:00.243 INFO 7496 --- [eerGroup Thread] org.bitcoinj.core.PeerGroup : Starting ...
2021-02-28 13:00:01.250 INFO 7496 --- [eerGroup Thread] org.bitcoinj.core.PeerGroup : Localhost peer not detected.
2021-02-28 13:00:01.251 INFO 7496 --- [eerGroup Thread] org.bitcoinj.core.PeerGroup : Peer discovery took 9.320 μs and returned 0 items