Browse Source

ckdb - add a console counter when loading payments and miningpayouts

master
kanoi 8 years ago
parent
commit
5b348f2bef
  1. 2
      src/ckdb.h
  2. 22
      src/ckdb_dbio.c

2
src/ckdb.h

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

22
src/ckdb_dbio.c

@ -2323,6 +2323,7 @@ unparam:
bool payments_fill(PGconn *conn)
{
char tickbuf[256], pcombuf[64];
ExecStatusType rescode;
PGresult *res;
K_ITEM *item = NULL;
@ -2335,6 +2336,9 @@ bool payments_fill(PGconn *conn)
LOGDEBUG("%s(): select", __func__);
STRNCPY(tickbuf, TICK_PREFIX"pm 0");
cr_msg(false, tickbuf);
sel = "declare ps cursor for select "
"paymentid,payoutid,userid,subname,paydate,payaddress,"
"originaltxn,amount,diffacc,committxn,commitblockhash"
@ -2449,6 +2453,13 @@ bool payments_fill(PGconn *conn)
add_to_ktree(payments_root, item);
k_add_head(payments_store, item);
if (n == 0 || ((n+1) % 100000) == 0) {
pcom(n+1, pcombuf, sizeof(pcombuf));
snprintf(tickbuf, sizeof(tickbuf),
TICK_PREFIX"pm %s", pcombuf);
cr_msg(false, tickbuf);
}
tick();
n++;
}
@ -6635,6 +6646,7 @@ unparam:
bool miningpayouts_fill(PGconn *conn)
{
char tickbuf[256], pcombuf[64];
ExecStatusType rescode;
PGresult *res;
K_ITEM *item = NULL;
@ -6647,6 +6659,9 @@ bool miningpayouts_fill(PGconn *conn)
LOGDEBUG("%s(): select", __func__);
STRNCPY(tickbuf, TICK_PREFIX"mp 0");
cr_msg(false, tickbuf);
sel = "declare mp cursor for select "
"payoutid,userid,diffacc,amount"
HISTORYDATECONTROL
@ -6735,6 +6750,13 @@ bool miningpayouts_fill(PGconn *conn)
add_to_ktree(miningpayouts_root, item);
k_add_head(miningpayouts_store, item);
if (n == 0 || ((n+1) % 100000) == 0) {
pcom(n+1, pcombuf, sizeof(pcombuf));
snprintf(tickbuf, sizeof(tickbuf),
TICK_PREFIX"mp %s", pcombuf);
cr_msg(false, tickbuf);
}
tick();
n++;
}

Loading…
Cancel
Save