Skip to content

Type discrepancy between corepc-types and Bitcoin Core #429

@deadmanoz

Description

@deadmanoz

I'm not sure if the types in corepc-types are supposed to faithfully match what Bitcoin Core RPC returns, but I noticed a discrepancy with tx_rate in GetChainTxStats. Bitcoin Core returns txrate as a double value (and has since the RPC was introduced in v0.15 PR #9733):

{
  "txrate": 5.153020888909642
}

The current types use i64 in the JSON structs and u32 in the model, yet f64 should be used if matching Bitcoin Core's output type is the goal?

I understand that this is a breaking change to the interface that people might already be using so wanted to raise it as an issue first before doing anything further.

And, in general, is the intent for the types to always match Bitcoin Core?

I found this as I was looking to extend some of the RPC extraction functionality being built out in peer-observer

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