It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
int64 nActualTimespan = pindexLast->GetBlockTime() - pindexFirst->GetBlockTime();
int64 lowLimit = nTargetTimespanLocal*denominator/numerator;
int64 highLimit = nTargetTimespanLocal*numerator/denominator;
int64 nActualTimespan = pindexLast->GetBlockTime() - pindexFirst->GetBlockTime();
nActualTimespan = nTargetTimespanLocal+nTargetSpacing*log(nTargetTimespanLocal/nActualTimespan)
int64 lowLimit = nTargetTimespanLocal*denominator/numerator;
int64 highLimit = nTargetTimespanLocal*numerator/denominator;
unsigned int static KimotoGravityWell(const CBlockIndex* pindexLast, const CBlockHeader *pblock, uint64 TargetBlocksSpacingSeconds, uint64 PastBlocksMin, uint64 PastBlocksMax) {
/* current difficulty formula, megacoin - kimoto gravity well */
const CBlockIndex *BlockLastSolved = pindexLast;
const CBlockIndex *BlockReading = pindexLast;
const CBlockHeader *BlockCreating = pblock;
BlockCreating = BlockCreating;
uint64 PastBlocksMass = 0;
int64 PastRateActualSeconds = 0;
int64 PastRateTargetSeconds = 0;
double PastRateAdjustmentRatio = double(1);
CBigNum PastDifficultyAverage;
CBigNum PastDifficultyAveragePrev;
double EventHorizonDeviation;
double EventHorizonDeviationFast;
double EventHorizonDeviationSlow;
if (BlockLastSolved == NULL || BlockLastSolved->nHeight == 0 || (uint64)BlockLastSolved->nHeight < PastBlocksMin) { return bnProofOfWorkLimit.GetCompact(); }
for (unsigned int i = 1; BlockReading && BlockReading->nHeight > 0; i++) {
if (PastBlocksMax > 0 && i > PastBlocksMax) { break; }
PastBlocksMass++;
if (i == 1) { PastDifficultyAverage.SetCompact(BlockReading->nBits); }
else { PastDifficultyAverage = ((CBigNum().SetCompact(BlockReading->nBits) - PastDifficultyAveragePrev) / i) + PastDifficultyAveragePrev; }
PastDifficultyAveragePrev = PastDifficultyAverage;
PastRateActualSeconds = BlockLastSolved->GetBlockTime() - BlockReading->GetBlockTime();
PastRateTargetSeconds = TargetBlocksSpacingSeconds * PastBlocksMass;
PastRateAdjustmentRatio = double(1);
if (PastRateActualSeconds < 0) { PastRateActualSeconds = 0; }
if (PastRateActualSeconds != 0 && PastRateTargetSeconds != 0) {
PastRateAdjustmentRatio = double(PastRateTargetSeconds) / double(PastRateActualSeconds);
}
EventHorizonDeviation = 1 + (0.7084 * pow((double(PastBlocksMass)/double(144)), -1.228));
EventHorizonDeviationFast = EventHorizonDeviation;
EventHorizonDeviationSlow = 1 / EventHorizonDeviation;
if (PastBlocksMass >= PastBlocksMin) {
if ((PastRateAdjustmentRatio <= EventHorizonDeviationSlow) || (PastRateAdjustmentRatio >= EventHorizonDeviationFast)) { assert(BlockReading); break; }
}
if (BlockReading->pprev == NULL) { assert(BlockReading); break; }
BlockReading = BlockReading->pprev;
}
CBigNum bnNew(PastDifficultyAverage);
if (PastRateActualSeconds != 0 && PastRateTargetSeconds != 0) {
bnNew *= PastRateActualSeconds;
bnNew /= PastRateTargetSeconds;
}
if (bnNew > bnProofOfWorkLimit) { bnNew = bnProofOfWorkLimit; }
/// debug print
printf("Difficulty Retarget - Kimoto Gravity Well\n");
printf("PastRateAdjustmentRatio = %g\n", PastRateAdjustmentRatio);
printf("Before: %08x %s\n", BlockLastSolved->nBits, CBigNum().SetCompact(BlockLastSolved->nBits).getuint256().ToString().c_str());
printf("After: %08x %s\n", bnNew.GetCompact(), bnNew.getuint256().ToString().c_str());
return bnNew.GetCompact();
}
unsigned int static GetNextWorkRequired_V2(const CBlockIndex* pindexLast, const CBlockHeader *pblock)
{
static const int64 BlocksTargetSpacing = 2.5 * 60; // 2.5 minutes
unsigned int TimeDaySeconds = 60 * 60 * 24;
int64 PastSecondsMin = TimeDaySeconds * 0.25;
int64 PastSecondsMax = TimeDaySeconds * 7;
uint64 PastBlocksMin = PastSecondsMin / BlocksTargetSpacing;
uint64 PastBlocksMax = PastSecondsMax / BlocksTargetSpacing;
return KimotoGravityWell(pindexLast, pblock, BlocksTargetSpacing, PastBlocksMin, PastBlocksMax);
}
// Basic 100 blocks averaging after the 4th livenet or 1st testnet hard fork
if((nHeight >= nForkFour) || (fTestNet && (nHeight >= nTestnetForkOne))) {
nInterval *= 5;
nTargetTimespan *= 5;
}
// Extended 500 blocks averaging after the 4th livenet or 1st testnet hard fork
if((nHeight >= nForkFour) || (fTestNet && (nHeight >= nTestnetForkOne))) {
nInterval *= 5;
const CBlockIndex* pindexFirst = pindexLast;
for(int i = 0; pindexFirst && i < nInterval; i++)
pindexFirst = pindexFirst->pprev;
int nActualTimespanExtended =
(pindexLast->GetBlockTime() - pindexFirst->GetBlockTime())/5;
// Average between the basic and extended windows
int nActualTimespanAvg = (nActualTimespan + nActualTimespanExtended)/2;
// Apply 0.1 damping
nActualTimespan = nActualTimespanAvg + 9*nTargetTimespan;
nActualTimespan /= 10;
printf("RETARGET: nActualTimespanExtended = %d (%d), nActualTimeSpanAvg = %d, nActualTimespan (damped) = %d\n",
nActualTimespanExtended, nActualTimespanExtended*5, nActualTimespanAvg, nActualTimespan);
}
// The 4th livenet or 1st testnet hard fork (1.02 difficulty limiter)
if((nHeight >= nForkFour) || (fTestNet && (nHeight >= nTestnetForkOne))) {
nActualTimespanMax = nTargetTimespan*102/100;
nActualTimespanMin = nTargetTimespan*100/102;
}
static const int64 nTargetTimespan = 6 * 60 * 60; // 6 hours
static const int64 nTargetSpacing = 10 * 60;
static const int64 nInterval = nTargetTimespan / nTargetSpacing;
static const int64 nTargetTimespanOld = 14 * 24 * 60 * 60; // two weeks
static const int64 nIntervalOld = nTargetTimespanOld / nTargetSpacing;
// after fork2Block we retarget every block
if(pindexLast->nHeight < fork2Block){
// Only change once per interval
if ((pindexLast->nHeight+1) % nIntervalLocal != 0)
// Go back by what we want to be 14 days worth of blocks
const CBlockIndex* pindexFirst = pindexLast;
for (int i = 0; pindexFirst && i < blockstogoback; i++)
pindexFirst = pindexFirst->pprev;
assert(pindexFirst);
// Limit adjustment step
int numerator = 4;
int denominator = 1;
if(pindexLast->nHeight >= fork2Block){
numerator = 112;
denominator = 100;
}
int64 nActualTimespan = pindexLast->GetBlockTime() - pindexFirst->GetBlockTime();
int64 lowLimit = nTargetTimespanLocal*denominator/numerator;
int64 highLimit = nTargetTimespanLocal*numerator/denominator;
printf(" nActualTimespan = %"PRI64d" before bounds\n", nActualTimespan);
if (nActualTimespan < lowLimit)
nActualTimespan = lowLimit;
if (nActualTimespan > highLimit)
nActualTimespan = highLimit;