Simplify difficulty calculation API

This commit is contained in:
Capri 2026-09-16 15:41:51 +00:00
commit e016663524
Signed by: VextaProject
SSH key fingerprint: SHA256:739BZv8LvIDY2tR7lXLy/IQ6MaGTQtYcG9GNvCjmpVM
4 changed files with 14 additions and 30 deletions

View file

@ -29,12 +29,12 @@ struct NodeContext;
static constexpr int NUM_GETBLOCKSTATS_PERCENTILES = 5;
/**
* Get the difficulty of the net wrt to the given block index.
* Get the difficulty represented by the given block index nBits.
*
* @return A floating point number that is a multiple of the main net minimum
* difficulty (4295032833 hashes).
*/
double GetDifficulty(const CBlockIndex* tip = NULL, const CBlockIndex* blockindex = nullptr);
double GetDifficulty(const CBlockIndex* blockindex);
/** Callback for when block tip changed. */
void RPCNotifyBlockChange(const CBlockIndex*);