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

RPC commands #128

Open
bitmarkcc opened this issue Jan 8, 2024 · 1 comment
Open

RPC commands #128

bitmarkcc opened this issue Jan 8, 2024 · 1 comment

Comments

@bitmarkcc
Copy link

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

@bitmarkcc
Copy link
Author

I fixed the way algo=/miningalgo= is used from the conf file. Now it covers all used cases. Here is the commit: bitmarkcc@444d8b0

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