Bitcoin
Functions
chain.cpp File Reference
#include <chain.h>

Functions

static int InvertLowestOne (int n)
 
static int GetSkipHeight (int height)
 
arith_uint256 GetBlockProof (const CBlockIndex &block)
 
int64_t GetBlockProofEquivalentTime (const CBlockIndex &to, const CBlockIndex &from, const CBlockIndex &tip, const Consensus::Params &params)
 
const CBlockIndexLastCommonAncestor (const CBlockIndex *pa, const CBlockIndex *pb)
 

Function Documentation

◆ GetBlockProof()

arith_uint256 GetBlockProof ( const CBlockIndex block)

◆ GetBlockProofEquivalentTime()

int64_t GetBlockProofEquivalentTime ( const CBlockIndex to,
const CBlockIndex from,
const CBlockIndex tip,
const Consensus::Params  
)

Return the time it would take to redo the work difference between from and to, assuming the current hashrate corresponds to the difficulty at tip, in seconds.

◆ GetSkipHeight()

static int GetSkipHeight ( int  height)
inlinestatic

Compute what height to jump back to with the CBlockIndex::pskip pointer.

◆ InvertLowestOne()

static int InvertLowestOne ( int  n)
inlinestatic

Turn the lowest '1' bit in the binary representation of a number into a '0'.

◆ LastCommonAncestor()

const CBlockIndex* LastCommonAncestor ( const CBlockIndex pa,
const CBlockIndex pb 
)

Find the last common ancestor two blocks have. Both pa and pb must be non-nullptr.