diff --git a/src/ckdb.c b/src/ckdb.c index e1479991..5e4f01ba 100644 --- a/src/ckdb.c +++ b/src/ckdb.c @@ -4235,6 +4235,8 @@ ASSERT4((sizeof(shift_words) == (sizeof(char *) * SHIFT_WORDS))); // optioncontrol name to override the SHIFT_DIFF_BLOCK value #define SHIFT_DIFF_BLOCK_STR "ShiftDiffBlock" +#define BLOCK_HALVING 210000 + static void make_a_shift_mark() { K_TREE_CTX ss_ctx[1], m_ctx[1], wi_ctx[1], b_ctx[1]; @@ -4499,7 +4501,7 @@ static void make_a_shift_mark() * changed */ if (strcmp(wi_bits, workinfo->bits) != 0) { if (workinfo->height > (int32_t)shiftdiffblock) { - LOGDEBUG("%s() OK shift stops at diff" + LOGDEBUG("%s() OK shift stops for a diff" " change '%s->%s' %"PRId64 "->%"PRId64" height %"PRId32 " limit %"PRId64, @@ -4512,6 +4514,19 @@ static void make_a_shift_mark() break; } } + // Halving? Stop at the last workinfo before it + if ((workinfo->height % BLOCK_HALVING) == 0) { + LOGDEBUG("%s() OK shift stops for a " + "halving wid %"PRId64 + "->%"PRId64" height %"PRId32 + " halving every %d", + __func__, prev_wid, + workinfo->workinfoid, + workinfo->height, + BLOCK_HALVING); + marks_wid = prev_wid; + break; + } } /* Did we find a pool restart? i.e. a wid skip * These will usually be a much larger jump, diff --git a/src/ckdb.h b/src/ckdb.h index aabf8285..a792a3b8 100644 --- a/src/ckdb.h +++ b/src/ckdb.h @@ -52,7 +52,7 @@ #define DB_VLOCK "1" #define DB_VERSION "1.0.7" -#define CKDB_VERSION DB_VERSION"-2.200" +#define CKDB_VERSION DB_VERSION"-2.201" #define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL_HERE __FILE__, __func__, __LINE__