Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/blockchain.cpp
Show All 32 Lines | |||||
#include <cstdint> | #include <cstdint> | ||||
#include <mutex> | #include <mutex> | ||||
struct CUpdatedBlock { | struct CUpdatedBlock { | ||||
uint256 hash; | uint256 hash; | ||||
int height; | int height; | ||||
}; | }; | ||||
static CWaitableCriticalSection cs_blockchange; | static Mutex cs_blockchange; | ||||
static std::condition_variable cond_blockchange; | static std::condition_variable cond_blockchange; | ||||
static CUpdatedBlock latestblock; | static CUpdatedBlock latestblock; | ||||
static double GetDifficultyFromBits(uint32_t nBits) { | static double GetDifficultyFromBits(uint32_t nBits) { | ||||
int nShift = (nBits >> 24) & 0xff; | int nShift = (nBits >> 24) & 0xff; | ||||
double dDiff = 0x0000ffff / double(nBits & 0x00ffffff); | double dDiff = 0x0000ffff / double(nBits & 0x00ffffff); | ||||
while (nShift < 29) { | while (nShift < 29) { | ||||
▲ Show 20 Lines • Show All 1,884 Lines • Show Last 20 Lines |