Browse Source

ckdb - ensure intransient fields are intransient

master
kanoi 8 years ago
parent
commit
90e48da06f
  1. 2
      src/ckdb.h
  2. 3
      src/ckdb_data.c
  3. 5
      src/ckdb_dbio.c

2
src/ckdb.h

@ -58,7 +58,7 @@
#define DB_VLOCK "1" #define DB_VLOCK "1"
#define DB_VERSION "1.0.7" #define DB_VERSION "1.0.7"
#define CKDB_VERSION DB_VERSION"-2.503" #define CKDB_VERSION DB_VERSION"-2.504"
#define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL " - from %s %s() line %d"
#define WHERE_FFL_HERE __FILE__, __func__, __LINE__ #define WHERE_FFL_HERE __FILE__, __func__, __LINE__

3
src/ckdb_data.c

@ -1206,7 +1206,8 @@ K_ITEM *_find_create_workerstatus(bool gotlock, bool alertcreate,
bzero(row, sizeof(*row)); bzero(row, sizeof(*row));
row->userid = userid; row->userid = userid;
row->in_workername = workername; row->in_workername = intransient_str("workername",
workername);
add_to_ktree(workerstatus_root, ws_item); add_to_ktree(workerstatus_root, ws_item);
k_add_head(workerstatus_store, ws_item); k_add_head(workerstatus_store, ws_item);

5
src/ckdb_dbio.c

@ -1480,7 +1480,6 @@ bool useratts_fill(PGconn *conn)
return ok; return ok;
} }
// WARNING: workername must be intransient
K_ITEM *workers_add(PGconn *conn, int64_t userid, char *workername, bool add_ws, K_ITEM *workers_add(PGconn *conn, int64_t userid, char *workername, bool add_ws,
char *difficultydefault, char *idlenotificationenabled, char *difficultydefault, char *idlenotificationenabled,
char *idlenotificationtime, char *by, char *code, char *idlenotificationtime, char *by, char *code,
@ -1530,7 +1529,7 @@ K_ITEM *workers_add(PGconn *conn, int64_t userid, char *workername, bool add_ws,
goto unitem; goto unitem;
row->userid = userid; row->userid = userid;
row->in_workername = workername; row->in_workername = intransient_str("workername", workername);
if (difficultydefault && *difficultydefault) { if (difficultydefault && *difficultydefault) {
diffdef = atoi(difficultydefault); diffdef = atoi(difficultydefault);
// If out of the range, set it in the range // If out of the range, set it in the range
@ -5651,6 +5650,7 @@ bool _sharesummary_update(SHARES *s_row, SHAREERRORS *e_row, tv_t *cd,
DATA_SHARESUMMARY(row, ss_item); DATA_SHARESUMMARY(row, ss_item);
bzero(row, sizeof(*row)); bzero(row, sizeof(*row));
row->userid = userid; row->userid = userid;
// workername is intransient
row->in_workername = workername; row->in_workername = workername;
row->workinfoid = workinfoid; row->workinfoid = workinfoid;
} }
@ -6051,6 +6051,7 @@ bool blocks_add(PGconn *conn, int32_t height, char *blockhash,
STRNCPY(row->confirmed, confirmed); STRNCPY(row->confirmed, confirmed);
STRNCPY(row->info, info); STRNCPY(row->info, info);
TXT_TO_BIGINT("workinfoid", workinfoid, row->workinfoid); TXT_TO_BIGINT("workinfoid", workinfoid, row->workinfoid);
// workername is intransient or EMPTY
row->in_workername = workername; row->in_workername = workername;
TXT_TO_INT("clientid", clientid, row->clientid); TXT_TO_INT("clientid", clientid, row->clientid);
STRNCPY(row->enonce1, enonce1); STRNCPY(row->enonce1, enonce1);

Loading…
Cancel
Save