Skip to content

json: cannot unmarshal number -1 into Go struct field GetBlockVerboseResult.confirmations of type uint64 #132

@avemeva

Description

@avemeva

@davecgh I have two bitcoind nodes in regtest mode, both connecting with each other locally. I am using rpcclient to get the information about block with GetBlockVerbose command.

I caused chain reorganisation by removing the data directory and restarting one of the nodes, this caused bitcoind to return -1 in confirmation number, which caused GetBlockVerbose fail with json: cannot unmarshal number -1 into Go struct field GetBlockVerboseResult.confirmations of type uint64.

Do you think that we could change uint64 to int64, to avoid such error, so that I could handle chain reorganisation properly in my service?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions