Categories
Cryptocurrency Ethereum Mastering Development

org.web3j 4.5.18 ethGetBalance get stuck

I’m using the following simple code in order to obtain the wallet balance:

Credentials credentials = Credentials.create(privateKey);  
web3.ethGetBalance(credentials.getAddress(), DefaultBlockParameterName.LATEST).sendAsync().get().getBalance();    

After retrieving the correct amount, the method simply get stuck, keeping running. Any idea?

Leave a Reply

Your email address will not be published. Required fields are marked *