Browse Source

Simplify createdate time to secs,nsecs

master
Con Kolivas 11 years ago
parent
commit
5a8e63e7a4
  1. 9
      src/stratifier.c

9
src/stratifier.c

@ -392,14 +392,10 @@ static void purge_share_hashtable(uint64_t wb_id)
/* This message will be sent to the database once it's hooked in */ /* This message will be sent to the database once it's hooked in */
static void send_workinfo(ckpool_t *ckp, workbase_t *wb) static void send_workinfo(ckpool_t *ckp, workbase_t *wb)
{ {
char *coinb1a, cdhex[20]; char *coinb1a, *cdhex;
uint64_t createdate;
json_t *val; json_t *val;
createdate = wb->gentime.tv_sec; ASPRINTF(&cdhex, "%lu,%lu", wb->gentime.tv_sec, wb->gentime.tv_nsec);
createdate *= 1000000000ull;
createdate += wb->gentime.tv_nsec;
sprintf(cdhex, "%016lx", createdate);
coinb1a = bin2hex(wb->coinb1a, wb->coinb1alen); coinb1a = bin2hex(wb->coinb1a, wb->coinb1alen);
val = json_pack("{ss,si,ss,ss,ss,ss,ss,ss,ss,ss,ss,ss}", val = json_pack("{ss,si,ss,ss,ss,ss,ss,ss,ss,ss,ss,ss}",
@ -416,6 +412,7 @@ static void send_workinfo(ckpool_t *ckp, workbase_t *wb)
"createcode", __func__, "createcode", __func__,
"createinet", "127.0.0.1"); "createinet", "127.0.0.1");
free(coinb1a); free(coinb1a);
free(cdhex);
json_decref(val); json_decref(val);
} }

Loading…
Cancel
Save