Skip to content

RPC commands #128

@bitmarkcc

Description

@bitmarkcc

Some of the rpc commands do not behave as expected.

In rpcblockchain.cpp:
The GetDifficulty method uses the tip's difficulty instead of the height specified (when passing next=true). The GetPeakHashrate and GetCurrentHashrate methods should convert the bignum to a uint256 instead of a ulong in order to allow for larger hashrates. GetAverageBlockSpacing should use MedianTimePast to be more reliable. The block variant info is not needed (block variant codes were made to allow for the signalling of multiple forks using the same version number).

In rpcclient.cpp:
Set generate returns a segmentation fault without a 3rd parameter. getblockreward can be made more useful by allowing a noScale parameter, to show the block reward without the CEM scaling.

In rpcmisc.cpp:
getblockspacing, getblockreward, and getdifficulty can be made more efficient by directly passing the height index to chainActive instead of walking back the blockindex to the needed height. The chaindynamics "sdifficulty" (unweighted difficulty) is passing NULL to the blockindex parameter. It should pass the blockindex corresponding to the requested height.

Solution: bitmarkcc@3719ed4 and bitmarkcc@ce4b6cd

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