Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on BitcoinJSONRPCClient.getDifficulty() #112

Open
henriquetft opened this issue May 13, 2020 · 0 comments
Open

Error on BitcoinJSONRPCClient.getDifficulty() #112

henriquetft opened this issue May 13, 2020 · 0 comments

Comments

@henriquetft
Copy link
Contributor

Sometimes it throws the following exception:

Exception in thread "main" java.lang.ClassCastException: java.lang.Long cannot be cast to java.math.BigDecimal
	at wf.bitcoin.javabitcoindrpcclient.BitcoinJSONRPCClient.getDifficulty(BitcoinJSONRPCClient.java:1005)
	

It occurs because bitcoin core not always return a decimal number from "getdifficulty" operation and
the response parser delivers the number as a Long in this case, but BitcoinJSONRPCClient.getDifficult tries to convert it to BigDecimal

@henriquetft henriquetft changed the title Error on BitcoinJSONRPCClient.getDifficult() Error on BitcoinJSONRPCClient.getDifficulty() May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant