From 2acf1d527c8c7fd5f0dbdbe8383c6fe4ed87a547 Mon Sep 17 00:00:00 2001 From: kanoi Date: Tue, 17 Jun 2014 00:43:09 +1000 Subject: [PATCH] ckdb - add missing poolinstance to workinfo_add --- src/ckdb.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ckdb.c b/src/ckdb.c index 12054252..3f237e42 100644 --- a/src/ckdb.c +++ b/src/ckdb.c @@ -1988,7 +1988,7 @@ static int64_t workinfo_add(PGconn *conn, char *workinfoidstr, char *poolinstanc int64_t workinfoid = -1; WORKINFO *row; char *ins; - char *params[10 + HISTORYDATECOUNT]; + char *params[11 + HISTORYDATECOUNT]; int par; LOGDEBUG("%s(): add", __func__); @@ -2016,6 +2016,7 @@ static int64_t workinfo_add(PGconn *conn, char *workinfoidstr, char *poolinstanc 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->transactiontree, NULL, 0); params[par++] = str_to_buf(row->merklehash, NULL, 0); params[par++] = str_to_buf(row->prevhash, NULL, 0); @@ -2029,9 +2030,9 @@ static int64_t workinfo_add(PGconn *conn, char *workinfoidstr, char *poolinstanc PARCHK(par, params); ins = "insert into workinfo " - "(workinfoid,transactiontree,merklehash,prevhash," - "coinbase1,coinbase2,version,bits,ntime,reward" - HISTORYDATECONTROL ") values (" PQPARAM15 ")"; + "(workinfoid,poolinstance,transactiontree,merklehash," + "prevhash,coinbase1,coinbase2,version,bits,ntime,reward" + HISTORYDATECONTROL ") values (" PQPARAM16 ")"; res = PQexecParams(conn, ins, par, NULL, (const char **)params, NULL, NULL, 0); rescode = PQresultStatus(res);