Merge branch 'duke' of https://git.hush.is/hush/hush3 into duke
This commit is contained in:
@@ -499,7 +499,12 @@ CAddrInfo CAddrMan::Select_(bool newOnly)
|
||||
MilliSleep(kRetrySleepInterval);
|
||||
}
|
||||
int nId = vvTried[nKBucket][nKBucketPos];
|
||||
assert(mapInfo.count(nId) == 1);
|
||||
// assert(mapInfo.count(nId) == 1);
|
||||
if(mapInfo.count(nId) != 1) {
|
||||
fprintf(stderr,"%s: Could not find tried node with nId=%d=vvTried[%d][%d], mapInfo.count(%d)=%lu\n", __func__, nId, nKBucket, nKBucketPos, nId, mapInfo.count(nId) );
|
||||
continue;
|
||||
}
|
||||
|
||||
CAddrInfo& info = mapInfo[nId];
|
||||
if (info.IsReachableNetwork()) {
|
||||
//deprioritize unreachable networks
|
||||
@@ -534,7 +539,12 @@ CAddrInfo CAddrMan::Select_(bool newOnly)
|
||||
MilliSleep(kRetrySleepInterval);
|
||||
}
|
||||
int nId = vvNew[nUBucket][nUBucketPos];
|
||||
assert(mapInfo.count(nId) == 1);
|
||||
|
||||
if(mapInfo.count(nId) != 1) {
|
||||
fprintf(stderr,"%s: Could not find new node with nId=%d=vvNew[%d][%d], mapInfo.count(%d)=%lu\n", __func__, nId, nUBucket, nUBucketPos, nId, mapInfo.count(nId) );
|
||||
continue;
|
||||
}
|
||||
// assert(mapInfo.count(nId) == 1);
|
||||
CAddrInfo& info = mapInfo[nId];
|
||||
if (info.IsReachableNetwork()) {
|
||||
//deprioritize unreachable networks
|
||||
|
||||
@@ -5114,7 +5114,9 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
|
||||
// changing at run-time, from Consensus::Params being a const struct
|
||||
unsigned int nNextWork = GetNextWorkRequired(pindexPrev, &block, consensusParams);
|
||||
|
||||
LogPrintf("%s: nbits ,%d,%lu,%lu,%d\n",__func__, nHeight, nNextWork, block.nBits, nNextWork - block.nBits );
|
||||
if (fDebug) {
|
||||
LogPrintf("%s: nbits ,%d,%lu,%lu,%d\n",__func__, nHeight, nNextWork, block.nBits, nNextWork - block.nBits );
|
||||
}
|
||||
if (block.nBits != nNextWork) {
|
||||
// Enforce correct nbits at DAA fork height, before that, ignore
|
||||
if (nHeight > daaForkHeight) {
|
||||
|
||||
11
src/pow.cpp
11
src/pow.cpp
@@ -503,8 +503,9 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
|
||||
nbits = bnTarget.GetCompact();
|
||||
nbits = (nbits & 0xfffffffc) | zawyflag;
|
||||
}
|
||||
//if(fDebug)
|
||||
if(fDebug) {
|
||||
fprintf(stderr,"%s: nbits=%d\n", __func__, nbits);
|
||||
}
|
||||
return(nbits);
|
||||
}
|
||||
|
||||
@@ -537,11 +538,15 @@ unsigned int CalculateNextWorkRequired(arith_uint256 bnAvg,
|
||||
|
||||
if ( ASSETCHAINS_ADAPTIVEPOW <= 0 ) {
|
||||
if (nActualTimespan < params.MinActualTimespan()) {
|
||||
fprintf(stderr,"%s: Adjusting nActualTimespan up to min value %li\n", __func__, params.MinActualTimespan() );
|
||||
if(fDebug) {
|
||||
fprintf(stderr,"%s: Adjusting nActualTimespan up to min value %li\n", __func__, params.MinActualTimespan() );
|
||||
}
|
||||
nActualTimespan = params.MinActualTimespan();
|
||||
}
|
||||
if (nActualTimespan > params.MaxActualTimespan()) {
|
||||
fprintf(stderr,"%s: Adjusting nActualTimespan down to max value %li\n", __func__, params.MaxActualTimespan() );
|
||||
if(fDebug) {
|
||||
fprintf(stderr,"%s: Adjusting nActualTimespan down to max value %li\n", __func__, params.MaxActualTimespan() );
|
||||
}
|
||||
nActualTimespan = params.MaxActualTimespan();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user