Skip to content

Error on BitcoinJSONRPCClient.getDifficulty() #112

@henriquetft

Description

@henriquetft

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions