diff --git a/src/ckdb.c b/src/ckdb.c index 0a692dfa..c74c3a88 100644 --- a/src/ckdb.c +++ b/src/ckdb.c @@ -5204,7 +5204,7 @@ static void make_a_shift_mark() return; setnow(&now); - ok = marks_process(NULL, true, workinfo->poolinstance, + ok = marks_process(NULL, true, workinfo->in_poolinstance, workinfo->workinfoid, description, EMPTY, MARKTYPE_OTHER_BEGIN_STR, MARK_USED_STR, (char *)by_default, (char *)__func__, @@ -5383,7 +5383,7 @@ static void make_a_shift_mark() return; } if (wi_bits[0] == '\0') - STRNCPY(wi_bits, workinfo->bits); + STRNCPY(wi_bits, workinfo->in_bits); else { /* Make sure you set the SHIFT_DIFF_BLOCK_STR * optioncontrol if you changed ckdb to V1.323 @@ -5405,14 +5405,14 @@ static void make_a_shift_mark() /* Did difficulty change? * Stop at the last workinfo, before the diff * changed */ - if (strcmp(wi_bits, workinfo->bits) != 0) { + if (strcmp(wi_bits, workinfo->in_bits) != 0) { if (workinfo->height > (int32_t)shiftdiffblock) { LOGDEBUG("%s() OK shift stops for a diff" " change '%s->%s' %"PRId64 "->%"PRId64" height %"PRId32 " limit %"PRId64, __func__, wi_bits, - workinfo->bits, prev_wid, + workinfo->in_bits, prev_wid, workinfo->workinfoid, workinfo->height, shiftdiffblock); @@ -5589,7 +5589,7 @@ static void make_a_shift_mark() } setnow(&now); - ok = marks_process(NULL, true, workinfo->poolinstance, + ok = marks_process(NULL, true, workinfo->in_poolinstance, marks_wid, des, extra, shifttype, status, (char *)by_default, (char *)__func__, (char *)inet_default, &now, NULL); diff --git a/src/ckdb.h b/src/ckdb.h index cafc6d55..afd30aeb 100644 --- a/src/ckdb.h +++ b/src/ckdb.h @@ -58,7 +58,7 @@ #define DB_VLOCK "1" #define DB_VERSION "1.0.7" -#define CKDB_VERSION DB_VERSION"-2.447" +#define CKDB_VERSION DB_VERSION"-2.448" #define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL_HERE __FILE__, __func__, __LINE__ @@ -1951,14 +1951,14 @@ extern K_STORE *esm_store; // WORKINFO workinfo.id.json={...} typedef struct workinfo { int64_t workinfoid; - char *poolinstance; + char *in_poolinstance; char *transactiontree; char *merklehash; - char *prevhash; + char *in_prevhash; char *coinbase1; char *coinbase2; - char *version; - char *bits; + char *in_version; + char *in_bits; char ntime[TXT_SML+1]; int64_t reward; int32_t height; // non-DB field diff --git a/src/ckdb_cmd.c b/src/ckdb_cmd.c index 3930b126..dcd6cc06 100644 --- a/src/ckdb_cmd.c +++ b/src/ckdb_cmd.c @@ -6232,7 +6232,7 @@ static char *cmd_marks(PGconn *conn, char *cmd, char *id, return strdup(reply); } DATA_WORKINFO(workinfo, w_item); - ok = marks_process(conn, true, workinfo->poolinstance, + ok = marks_process(conn, true, workinfo->in_poolinstance, workinfoid, description, extra, marktype, status, by, code, inet, cd, trf_root); } else if (strcasecmp(action, "expire") == 0) { @@ -7145,7 +7145,7 @@ static char *cmd_query(__maybe_unused PGconn *conn, char *cmd, char *id, APPEND_REALLOC(buf, off, len, tmp); snprintf(tmp, sizeof(tmp), "prevhash:%d=%s%c", - rows, workinfo->prevhash, FLDSEP); + rows, workinfo->in_prevhash, FLDSEP); APPEND_REALLOC(buf, off, len, tmp); tv_to_buf(&(workinfo->expirydate), cd_buf, sizeof(cd_buf)); @@ -7354,7 +7354,7 @@ static char *cmd_query(__maybe_unused PGconn *conn, char *cmd, char *id, this_height = workinfo->height; if (this_height == height) { // We have our starting point - STRNCPY(bits, workinfo->bits); + STRNCPY(bits, workinfo->in_bits); got = true; bigint_to_buf(workinfo->workinfoid, @@ -7371,7 +7371,7 @@ static char *cmd_query(__maybe_unused PGconn *conn, char *cmd, char *id, while (wi_item) { if (CURRENT(&(workinfo->expirydate))) { - if (strcmp(bits, workinfo->bits) != 0) + if (strcmp(bits, workinfo->in_bits) != 0) break; } wi_item = next_in_ktree(ctx); diff --git a/src/ckdb_data.c b/src/ckdb_data.c index 6855ac63..60fff4d3 100644 --- a/src/ckdb_data.c +++ b/src/ckdb_data.c @@ -2612,14 +2612,14 @@ bool workinfo_age(int64_t workinfoid, char *poolinstance, tv_t *cd, } DATA_WORKINFO(workinfo, wi_item); - if (strcmp(poolinstance, workinfo->poolinstance) != 0) { + if (strcmp(poolinstance, workinfo->in_poolinstance) != 0) { tv_to_buf(cd, cd_buf, sizeof(cd_buf)); LOGERR("%s() %"PRId64"/%s/%ld,%ld %.19s Poolinstance changed " // "(from %s)! Age discarded!", "(from %s)! Age not discarded", __func__, workinfoid, poolinstance, cd->tv_sec, cd->tv_usec, cd_buf, - workinfo->poolinstance); + workinfo->in_poolinstance); // TODO: ckdb only supports one, so until multiple support is written: // goto bye; } @@ -6608,7 +6608,7 @@ static bool gen_workmarkers(PGconn *conn, MARKS *stt, bool after, MARKS *fin, fin->description, before ? "--" : ""); ok = workmarkers_process(conn, false, true, 0, - wi_fin->poolinstance, + wi_fin->in_poolinstance, wi_fin->workinfoid, wi_stt->workinfoid, description, MARKER_READY_STR, by, code, inet, cd, trf_root); @@ -6617,7 +6617,7 @@ static bool gen_workmarkers(PGconn *conn, MARKS *stt, bool after, MARKS *fin, return false; } - ok = marks_process(conn, true, wi_fin->poolinstance, fin->workinfoid, + ok = marks_process(conn, true, wi_fin->in_poolinstance, fin->workinfoid, fin->description, fin->extra, fin->marktype, MARK_USED_STR, by, code, inet, cd, trf_root); diff --git a/src/ckdb_dbio.c b/src/ckdb_dbio.c index d29b08f6..2231fbf5 100644 --- a/src/ckdb_dbio.c +++ b/src/ckdb_dbio.c @@ -3158,14 +3158,14 @@ int64_t workinfo_add(PGconn *conn, char *workinfoidstr, bzero(row, sizeof(*row)); TXT_TO_BIGINT("workinfoid", workinfoidstr, row->workinfoid); - row->poolinstance = in_poolinstance->str; + row->in_poolinstance = in_poolinstance->str; DUP_POINTER(workinfo_free, row->transactiontree, transactiontree); DUP_POINTER(workinfo_free, row->merklehash, merklehash); - row->prevhash = in_prevhash->str; + row->in_prevhash = in_prevhash->str; DUP_POINTER(workinfo_free, row->coinbase1, coinbase1); DUP_POINTER(workinfo_free, row->coinbase2, coinbase2); - row->version = in_version->str; - row->bits = in_bits->str; + row->in_version = in_version->str; + row->in_bits = in_bits->str; STRNCPY(row->ntime, ntime); TXT_TO_BIGINT("reward", reward, row->reward); pool.reward = row->reward; @@ -3193,14 +3193,14 @@ int64_t workinfo_add(PGconn *conn, char *workinfoidstr, if (!confirm_sharesummary) { par = 0; params[par++] = bigint_to_buf(row->workinfoid, NULL, 0); - params[par++] = str_to_buf(row->poolinstance, NULL, 0); + params[par++] = str_to_buf(row->in_poolinstance, NULL, 0); params[par++] = str_to_buf(row->transactiontree, NULL, 0); params[par++] = str_to_buf(row->merklehash, NULL, 0); - params[par++] = str_to_buf(row->prevhash, NULL, 0); + params[par++] = str_to_buf(row->in_prevhash, NULL, 0); params[par++] = str_to_buf(row->coinbase1, NULL, 0); params[par++] = str_to_buf(row->coinbase2, NULL, 0); - params[par++] = str_to_buf(row->version, NULL, 0); - params[par++] = str_to_buf(row->bits, NULL, 0); + params[par++] = str_to_buf(row->in_version, NULL, 0); + params[par++] = str_to_buf(row->in_bits, NULL, 0); params[par++] = str_to_buf(row->ntime, NULL, 0); params[par++] = bigint_to_buf(row->reward, NULL, 0); HISTORYDATEPARAMS(params, par, row); @@ -3247,7 +3247,7 @@ unparam: FREENULL(row->merklehash); row->height = coinbase1height(row); - hex2bin(ndiffbin, row->bits, 4); + hex2bin(ndiffbin, row->in_bits, 4); row->diff_target = current_ndiff = diff_from_nbits(ndiffbin); add_to_ktree(workinfo_root, item); @@ -3392,7 +3392,7 @@ bool workinfo_fill(PGconn *conn) POOLINSTANCE_DBLOAD_SET(workinfo, field); continue; } - row->poolinstance = intransient_str("poolinstance", field); + row->in_poolinstance = intransient_str("poolinstance", field); PQ_GET_FLD(res, i, "workinfoid", field, ok); if (!ok) @@ -3405,7 +3405,7 @@ bool workinfo_fill(PGconn *conn) PQ_GET_FLD(res, i, "prevhash", field, ok); if (!ok) break; - row->prevhash = intransient_str("prevhash", field); + row->in_prevhash = intransient_str("prevhash", field); PQ_GET_FLD(res, i, "coinbase1", field, ok); if (!ok) @@ -3422,12 +3422,12 @@ bool workinfo_fill(PGconn *conn) PQ_GET_FLD(res, i, "version", field, ok); if (!ok) break; - row->version = intransient_str("version", field); + row->in_version = intransient_str("version", field); PQ_GET_FLD(res, i, "bits", field, ok); if (!ok) break; - row->bits = intransient_str("bits", field); + row->in_bits = intransient_str("bits", field); PQ_GET_FLD(res, i, "ntime", field, ok); if (!ok) @@ -3445,7 +3445,7 @@ bool workinfo_fill(PGconn *conn) break; row->height = coinbase1height(row); - hex2bin(ndiffbin, row->bits, 4); + hex2bin(ndiffbin, row->in_bits, 4); row->diff_target = diff_from_nbits(ndiffbin); add_to_ktree(workinfo_root, item);