From 5e59102ba21180dcbbe9f95aa7cf94724f2f3edd Mon Sep 17 00:00:00 2001 From: kanoi Date: Tue, 9 Sep 2014 00:33:50 +1000 Subject: [PATCH 01/11] ckdb - fix sharesummary locking --- src/ckdb.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/ckdb.c b/src/ckdb.c index a006b71a..3f592387 100644 --- a/src/ckdb.c +++ b/src/ckdb.c @@ -47,7 +47,7 @@ #define DB_VLOCK "1" #define DB_VERSION "0.9" -#define CKDB_VERSION DB_VERSION"-0.252" +#define CKDB_VERSION DB_VERSION"-0.260" #define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL_HERE __FILE__, __func__, __LINE__ @@ -2460,7 +2460,7 @@ static void set_block_share_counters() ss_item = prev_in_ktree(ctx); } - K_RLOCK(sharesummary_free); + K_RUNLOCK(sharesummary_free); } /* All data is loaded, now update workerstatus fields @@ -4196,7 +4196,6 @@ static bool workinfo_age(PGconn *conn, int64_t workinfoid, char *poolinstance, if (error[0]) LOGERR("%s(): %s", __func__, error); } - K_RUNLOCK(sharesummary_free); if (conned) PQfinish(conn); @@ -4305,9 +4304,7 @@ static void auto_age_older(PGconn *conn, int64_t workinfoid, char *poolinstance, wid_count++; K_RLOCK(sharesummary_free); while (ss_item && sharesummary->workinfoid == to_id) { - K_RLOCK(sharesummary_free); ss_item = next_in_ktree(ctx); - K_RUNLOCK(sharesummary_free); DATA_SHARESUMMARY_NULL(sharesummary, ss_item); } K_RUNLOCK(sharesummary_free); @@ -5224,7 +5221,6 @@ static bool sharesummary_fill(PGconn *conn) n = PQntuples(res); LOGDEBUG("%s(): tree build count %d", __func__, n); ok = true; - K_WLOCK(sharesummary_free); for (i = 0; i < n; i++) { item = k_unlink_head(sharesummary_free); DATA_SHARESUMMARY(row, item); @@ -5369,7 +5365,6 @@ static bool sharesummary_fill(PGconn *conn) if (!ok) k_add_head(sharesummary_free, item); - K_WUNLOCK(sharesummary_free); PQclear(res); if (ok) { @@ -5384,11 +5379,9 @@ void sharesummary_reload() { PGconn *conn = dbconnect(); - K_WLOCK(sharesummary_free); sharesummary_root = free_ktree(sharesummary_root, NULL); sharesummary_workinfoid_root = free_ktree(sharesummary_workinfoid_root, NULL); k_list_transfer_to_head(sharesummary_store, sharesummary_free); - K_WUNLOCK(sharesummary_free); sharesummary_fill(conn); From f4d47c3cb3f968d78b52ea16c6a09a458c8db808 Mon Sep 17 00:00:00 2001 From: kanoi Date: Tue, 9 Sep 2014 08:02:49 +1000 Subject: [PATCH 02/11] php - reverse/correct the web page calculation on orphans --- pool/page_blocks.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pool/page_blocks.php b/pool/page_blocks.php index 4fda69df..c4660c54 100644 --- a/pool/page_blocks.php +++ b/pool/page_blocks.php @@ -89,9 +89,9 @@ function doblocks($data, $user) list($fg, $bg) = pctcolour($pct); $bpct = "".number_format($pct, 2).'%'; $bg = " bgcolor=$bg"; - $nettot += $netdiff; + $blktot += $diffacc; if ($stat != 'Orphan') - $blktot += $diffacc; + $nettot += $netdiff; } else { From 29b93c24eff6a54732a8853a510422a0f3248bdb Mon Sep 17 00:00:00 2001 From: kanoi Date: Tue, 9 Sep 2014 08:19:19 +1000 Subject: [PATCH 03/11] php - label workers total --- pool/page_workers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pool/page_workers.php b/pool/page_workers.php index 84b306d3..4eb8707b 100644 --- a/pool/page_workers.php +++ b/pool/page_workers.php @@ -144,7 +144,7 @@ function doworker($data, $user) $row = 'even'; else $row = 'odd'; - $pg .= ""; + $pg .= "Total:"; $shareacc = number_format($tsh, 0); $pg .= "$shareacc"; $diffacc = number_format($tdif, 0); From a323feb872d0ee182d37997643e6d9de23d6a719 Mon Sep 17 00:00:00 2001 From: kanoi Date: Tue, 9 Sep 2014 11:04:58 +1000 Subject: [PATCH 04/11] ckdb - incorrect transfer variable --- src/ckdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ckdb.c b/src/ckdb.c index 3f592387..b37f47f7 100644 --- a/src/ckdb.c +++ b/src/ckdb.c @@ -911,7 +911,7 @@ static char *_transfer_data(K_ITEM *item, WHERE_FFL_ARGS) * since mvalue is NULL */ quitfrom(1, file, func, line, "Transfer '%s' '%s' has NULL mvalue", - transfer->name, transfer->mvalue); + transfer->name, transfer->svalue); } return mvalue; } From 13f50e33294155384caf59b33a15b4077f4580e3 Mon Sep 17 00:00:00 2001 From: kanoi Date: Tue, 9 Sep 2014 14:44:37 +1000 Subject: [PATCH 05/11] ckdb - fix block tree corruptions --- src/ckdb.c | 55 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 23 deletions(-) diff --git a/src/ckdb.c b/src/ckdb.c index b37f47f7..ac2784fa 100644 --- a/src/ckdb.c +++ b/src/ckdb.c @@ -47,7 +47,7 @@ #define DB_VLOCK "1" #define DB_VERSION "0.9" -#define CKDB_VERSION DB_VERSION"-0.260" +#define CKDB_VERSION DB_VERSION"-0.270" #define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL_HERE __FILE__, __func__, __LINE__ @@ -674,7 +674,8 @@ static const tv_t date_begin = { DATE_BEGIN, 0L }; #define PQPARAM14 PQPARAM8 ",$9,$10,$11,$12,$13,$14" #define PQPARAM15 PQPARAM8 ",$9,$10,$11,$12,$13,$14,$15" #define PQPARAM16 PQPARAM8 ",$9,$10,$11,$12,$13,$14,$15,$16" -#define PQPARAM27 PQPARAM16 ",$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27" +#define PQPARAM22 PQPARAM16 ",$17,$18,$19,$20,$21,$22" +#define PQPARAM27 PQPARAM22 ",$23,$24,$25,$26,$27" #define PARCHK(_par, _params) do { \ if (_par != (int)(sizeof(_params)/sizeof(_params[0]))) { \ @@ -1302,7 +1303,9 @@ typedef struct blocks { #define BLOCKS_ORPHAN_STR "O" #define BLOCKS_STATSPENDING FALSE_CHR +#define BLOCKS_STATSPENDING_STR FALSE_STR #define BLOCKS_STATSCONFIRMED TRUE_CHR +#define BLOCKS_STATSCONFIRMED_STR TRUE_STR static const char *blocks_new = "New"; static const char *blocks_confirm = "1-Confirm"; @@ -5413,9 +5416,10 @@ static void dsp_blocks(K_ITEM *item, FILE *stream) dsp_hash(b->blockhash, hash_dsp, sizeof(hash_dsp)); tv_to_buf(&(b->createdate), createdate_buf, sizeof(createdate_buf)); tv_to_buf(&(b->expirydate), expirydate_buf, sizeof(expirydate_buf)); - fprintf(stream, " hi=%d hash='%.16s' uid=%"PRId64" w='%s' " - "cd=%s ed=%s\n", - b->height, hash_dsp, b->userid, b->workername, + fprintf(stream, " hi=%d hash='%.16s' conf=%s uid=%"PRId64 + " w='%s' sconf=%s cd=%s ed=%s\n", + b->height, hash_dsp, b->confirmed, b->userid, + b->workername, b->statsconfirmed, createdate_buf, expirydate_buf); } } @@ -5525,12 +5529,12 @@ static bool blocks_stats(PGconn *conn, int32_t height, char *blockhash, K_RUNLOCK(blocks_free); if (!old_b_item) { - LOGERR("%s(): Non-existent Block: %s/...%s", + LOGERR("%s(): Non-existent Block: %d/...%s", __func__, height, hash_dsp); return false; } - DATA_BLOCKS_NULL(oldblocks, old_b_item); + DATA_BLOCKS(oldblocks, old_b_item); K_WLOCK(blocks_free); b_item = k_unlink_head(blocks_free); @@ -5659,7 +5663,7 @@ static bool blocks_add(PGconn *conn, char *height, char *blockhash, BLOCKS *row, *oldblocks; USERS *users; char *upd, *ins; - char *params[11 + HISTORYDATECOUNT]; + char *params[17 + HISTORYDATECOUNT]; bool ok = false, update_old = false; int par = 0; char want = '?'; @@ -5678,14 +5682,16 @@ static bool blocks_add(PGconn *conn, char *height, char *blockhash, dsp_hash(blockhash, hash_dsp, sizeof(hash_dsp)); - K_WLOCK(blocks_free); + K_RLOCK(blocks_free); old_b_item = find_blocks(row->height, blockhash); + K_RUNLOCK(blocks_free); DATA_BLOCKS_NULL(oldblocks, old_b_item); switch (confirmed[0]) { case BLOCKS_NEW: // None should exist - so must be a duplicate if (old_b_item) { + K_WLOCK(blocks_free); k_add_head(blocks_free, b_item); K_WUNLOCK(blocks_free); if (!igndup) { @@ -5699,7 +5705,6 @@ static bool blocks_add(PGconn *conn, char *height, char *blockhash, } return true; } - K_WUNLOCK(blocks_free); K_RLOCK(users_free); u_item = find_users(username); @@ -5719,6 +5724,13 @@ static bool blocks_add(PGconn *conn, char *height, char *blockhash, STRNCPY(row->nonce2, nonce2); STRNCPY(row->nonce, nonce); TXT_TO_BIGINT("reward", reward, row->reward); + // Specify them + row->diffacc = 0; + row->diffinv = 0; + row->shareacc = 0; + row->shareinv = 0; + row->elapsed = 0; + STRNCPY(row->statsconfirmed, BLOCKS_STATSPENDING_STR); HISTORYDATEINIT(row, cd, by, code, inet); HISTORYDATETRANSFER(trf_root, row); @@ -5735,14 +5747,21 @@ static bool blocks_add(PGconn *conn, char *height, char *blockhash, params[par++] = str_to_buf(row->nonce, NULL, 0); params[par++] = bigint_to_buf(row->reward, NULL, 0); params[par++] = str_to_buf(row->confirmed, NULL, 0); + params[par++] = double_to_buf(row->diffacc, NULL, 0); + params[par++] = double_to_buf(row->diffinv, NULL, 0); + params[par++] = double_to_buf(row->shareacc, NULL, 0); + params[par++] = double_to_buf(row->shareinv, NULL, 0); + params[par++] = bigint_to_buf(row->elapsed, NULL, 0); + params[par++] = str_to_buf(row->statsconfirmed, NULL, 0); HISTORYDATEPARAMS(params, par, row); PARCHK(par, params); - // db default stats values ins = "insert into blocks " "(height,blockhash,workinfoid,userid,workername," - "clientid,enonce1,nonce2,nonce,reward,confirmed" - HISTORYDATECONTROL ") values (" PQPARAM16 ")"; + "clientid,enonce1,nonce2,nonce,reward,confirmed," + "diffacc,diffinv,shareacc,shareinv,elapsed," + "statsconfirmed" + HISTORYDATECONTROL ") values (" PQPARAM22 ")"; if (conn == NULL) { conn = dbconnect(); @@ -5760,7 +5779,6 @@ static bool blocks_add(PGconn *conn, char *height, char *blockhash, case BLOCKS_42: // These shouldn't be possible until startup completes if (!startup_complete) { - K_WUNLOCK(blocks_free); tv_to_buf(cd, cd_buf, sizeof(cd_buf)); LOGERR("%s(): Status: %s invalid during startup. " "Ignored: Block: %s/...%s/%s", @@ -5772,7 +5790,6 @@ static bool blocks_add(PGconn *conn, char *height, char *blockhash, want = BLOCKS_CONFIRM; case BLOCKS_CONFIRM: if (!old_b_item) { - K_WUNLOCK(blocks_free); tv_to_buf(cd, cd_buf, sizeof(cd_buf)); LOGERR("%s(): Can't %s a non-existent Block: %s/...%s/%s", __func__, blocks_confirmed(confirmed), @@ -5782,8 +5799,6 @@ static bool blocks_add(PGconn *conn, char *height, char *blockhash, if (confirmed[0] == BLOCKS_CONFIRM) want = BLOCKS_NEW; if (oldblocks->confirmed[0] != want) { - k_add_head(blocks_free, b_item); - K_WUNLOCK(blocks_free); // No mismatch messages during startup if (startup_complete) { tv_to_buf(cd, cd_buf, sizeof(cd_buf)); @@ -5796,7 +5811,6 @@ static bool blocks_add(PGconn *conn, char *height, char *blockhash, } goto flail; } - K_WUNLOCK(blocks_free); upd = "update blocks set expirydate=$1 where blockhash=$2 and expirydate=$3"; par = 0; @@ -5899,7 +5913,6 @@ static bool blocks_add(PGconn *conn, char *height, char *blockhash, res = PQexec(conn, "Commit", CKPQ_WRITE); break; default: - K_WUNLOCK(blocks_free); LOGERR("%s(): %s.failed.invalid confirm='%s'", __func__, id, confirmed); goto flail; @@ -6027,7 +6040,6 @@ static bool blocks_fill(PGconn *conn) n = PQntuples(res); LOGDEBUG("%s(): tree build count %d", __func__, n); ok = true; - K_WLOCK(blocks_free); for (i = 0; i < n; i++) { item = k_unlink_head(blocks_free); DATA_BLOCKS(row, item); @@ -6133,7 +6145,6 @@ static bool blocks_fill(PGconn *conn) if (!ok) k_add_head(blocks_free, item); - K_WUNLOCK(blocks_free); PQclear(res); if (ok) { @@ -6148,10 +6159,8 @@ void blocks_reload() { PGconn *conn = dbconnect(); - K_WLOCK(blocks_free); blocks_root = free_ktree(blocks_root, NULL); k_list_transfer_to_head(blocks_store, blocks_free); - K_WUNLOCK(blocks_free); blocks_fill(conn); From bc08ba3b02809b3ec70ec12f35ce1a7e22002c4d Mon Sep 17 00:00:00 2001 From: kanoi Date: Tue, 9 Sep 2014 15:05:02 +1000 Subject: [PATCH 06/11] php - Diff on orphan is included so don't strike it out --- pool/page_blocks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pool/page_blocks.php b/pool/page_blocks.php index c4660c54..7f308ee2 100644 --- a/pool/page_blocks.php +++ b/pool/page_blocks.php @@ -105,7 +105,7 @@ function doblocks($data, $user) $pg .= "".btcfmt($ans['reward:'.$i]).''; $pg .= "".gmdate('Y-m-d H:i:s+00', $ans['firstcreatedate:'.$i]).''; $pg .= "".$stat.''; - $pg .= "".$acc.''; + $pg .= "".$acc.''; $pg .= "".$bpct.''; $pg .= "\n"; } From 1155437aebb6aa3d1fbdf0c7e618327503aa6514 Mon Sep 17 00:00:00 2001 From: kanoi Date: Tue, 9 Sep 2014 15:07:01 +1000 Subject: [PATCH 07/11] php - ... and the % also --- pool/page_blocks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pool/page_blocks.php b/pool/page_blocks.php index 7f308ee2..c44c2d5f 100644 --- a/pool/page_blocks.php +++ b/pool/page_blocks.php @@ -106,7 +106,7 @@ function doblocks($data, $user) $pg .= "".gmdate('Y-m-d H:i:s+00', $ans['firstcreatedate:'.$i]).''; $pg .= "".$stat.''; $pg .= "".$acc.''; - $pg .= "".$bpct.''; + $pg .= "".$bpct.''; $pg .= "\n"; } } From 884174b7c91d05811c5dee3737c694e92de535d6 Mon Sep 17 00:00:00 2001 From: kanoi Date: Tue, 9 Sep 2014 16:26:18 +1000 Subject: [PATCH 08/11] ckdb - missing ',' in DB orphan update --- src/ckdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ckdb.c b/src/ckdb.c index ac2784fa..084048e2 100644 --- a/src/ckdb.c +++ b/src/ckdb.c @@ -47,7 +47,7 @@ #define DB_VLOCK "1" #define DB_VERSION "0.9" -#define CKDB_VERSION DB_VERSION"-0.270" +#define CKDB_VERSION DB_VERSION"-0.271" #define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL_HERE __FILE__, __func__, __LINE__ @@ -5894,7 +5894,7 @@ static bool blocks_add(PGconn *conn, char *height, char *blockhash, "height,blockhash,workinfoid,userid,workername," "clientid,enonce1,nonce2,nonce,reward," "$3,diffacc,diffinv,shareacc,shareinv,elapsed," - "statsconfirmed" + "statsconfirmed," "$4,$5,$6,$7,$8 from blocks where " "blockhash=$1 and expirydate=$2"; } From 7858a71492d058ac12daf151501e3248b315a881 Mon Sep 17 00:00:00 2001 From: kanoi Date: Tue, 9 Sep 2014 16:38:30 +1000 Subject: [PATCH 09/11] php - '*' mark blocks after orphans --- pool/page.php | 4 ++++ pool/page_blocks.php | 16 +++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/pool/page.php b/pool/page.php index 3fdf0525..54eafadd 100644 --- a/pool/page.php +++ b/pool/page.php @@ -129,6 +129,10 @@ h1 {margin-top: 20px; float:middle; font-size: 20px;} .dls {text-align: left; padding: 2px 8px; text-decoration:line-through; font-weight:lighter; } .drs {text-align: right; padding: 2px 8px; text-decoration:line-through; font-weight:lighter; } .dcs {text-align: center; padding: 2px 8px; text-decoration:line-through; font-weight:lighter; } +.st0 {font-weight:bold; } +.st1 {color:red; font-weight:bold; } +.st2 {color:green; font-weight:bold; } +.st3 {color:blue; font-weight:bold; } \n"; $head .= ''; diff --git a/pool/page_blocks.php b/pool/page_blocks.php index c44c2d5f..043569ff 100644 --- a/pool/page_blocks.php +++ b/pool/page_blocks.php @@ -76,6 +76,16 @@ function doblocks($data, $user) if ($stat == '1-Confirm') $stat = 'Conf'; + $stara = ''; + $starp = ''; + if (isset($ans['status:'.($i+1)])) + if ($ans['status:'.($i+1)] == 'Orphan' + && $stat != 'Orphan') + { + $stara = '*'; + $starp = '*'; + } + $hi = $ans['height:'.$i]; $hifld = "$blink$hi>$hi"; @@ -87,7 +97,7 @@ function doblocks($data, $user) { $pct = 100.0 * $diffacc / $netdiff; list($fg, $bg) = pctcolour($pct); - $bpct = "".number_format($pct, 2).'%'; + $bpct = "$starp".number_format($pct, 2).'%'; $bg = " bgcolor=$bg"; $blktot += $diffacc; if ($stat != 'Orphan') @@ -105,8 +115,8 @@ function doblocks($data, $user) $pg .= "".btcfmt($ans['reward:'.$i]).''; $pg .= "".gmdate('Y-m-d H:i:s+00', $ans['firstcreatedate:'.$i]).''; $pg .= "".$stat.''; - $pg .= "".$acc.''; - $pg .= "".$bpct.''; + $pg .= "$stara$acc"; + $pg .= "$bpct"; $pg .= "\n"; } } From d36412ab40a92af87de7ea15d07b3a3673d6094d Mon Sep 17 00:00:00 2001 From: kanoi Date: Tue, 9 Sep 2014 17:41:24 +1000 Subject: [PATCH 10/11] ckdb - don't (int)double - it crashes --- src/ckdb.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/ckdb.c b/src/ckdb.c index 084048e2..bc98c738 100644 --- a/src/ckdb.c +++ b/src/ckdb.c @@ -47,7 +47,7 @@ #define DB_VLOCK "1" #define DB_VERSION "0.9" -#define CKDB_VERSION DB_VERSION"-0.271" +#define CKDB_VERSION DB_VERSION"-0.272" #define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL_HERE __FILE__, __func__, __LINE__ @@ -961,6 +961,7 @@ typedef struct users { #define LIMIT_USERS 0 #define INIT_USERS(_item) INIT_GENERIC(_item, users) #define DATA_USERS(_var, _item) DATA_GENERIC(_var, _item, users, true) +#define DATA_USERS_NULL(_var, _item) DATA_GENERIC(_var, _item, users, false) static K_TREE *users_root; static K_TREE *userid_root; @@ -8751,23 +8752,23 @@ static char *cmd_workers(__maybe_unused PGconn *conn, char *cmd, char *id, snprintf(tmp, sizeof(tmp), "w_lastshare:%d=%s%c", rows, reply, FLDSEP); APPEND_REALLOC(buf, off, len, tmp); - double_to_buf((int)(w_lastdiff), reply, sizeof(reply)); + double_to_buf(w_lastdiff, reply, sizeof(reply)); snprintf(tmp, sizeof(tmp), "w_lastdiff:%d=%s%c", rows, reply, FLDSEP); APPEND_REALLOC(buf, off, len, tmp); - double_to_buf((int)(w_diffacc), reply, sizeof(reply)); + double_to_buf(w_diffacc, reply, sizeof(reply)); snprintf(tmp, sizeof(tmp), "w_diffacc:%d=%s%c", rows, reply, FLDSEP); APPEND_REALLOC(buf, off, len, tmp); - double_to_buf((int)(w_diffinv), reply, sizeof(reply)); + double_to_buf(w_diffinv, reply, sizeof(reply)); snprintf(tmp, sizeof(tmp), "w_diffinv:%d=%s%c", rows, reply, FLDSEP); APPEND_REALLOC(buf, off, len, tmp); - double_to_buf((int)(w_shareacc), reply, sizeof(reply)); + double_to_buf(w_shareacc, reply, sizeof(reply)); snprintf(tmp, sizeof(tmp), "w_shareacc:%d=%s%c", rows, reply, FLDSEP); APPEND_REALLOC(buf, off, len, tmp); - double_to_buf((int)(w_shareinv), reply, sizeof(reply)); + double_to_buf(w_shareinv, reply, sizeof(reply)); snprintf(tmp, sizeof(tmp), "w_shareinv:%d=%s%c", rows, reply, FLDSEP); APPEND_REALLOC(buf, off, len, tmp); From d6b306e01bb9e2fc1ad334a6b48979a5afc8c353 Mon Sep 17 00:00:00 2001 From: kanoi Date: Tue, 9 Sep 2014 21:20:12 +1000 Subject: [PATCH 11/11] ckdb - fix settings password problem --- src/ckdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ckdb.c b/src/ckdb.c index bc98c738..80492eba 100644 --- a/src/ckdb.c +++ b/src/ckdb.c @@ -47,7 +47,7 @@ #define DB_VLOCK "1" #define DB_VERSION "0.9" -#define CKDB_VERSION DB_VERSION"-0.272" +#define CKDB_VERSION DB_VERSION"-0.273" #define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL_HERE __FILE__, __func__, __LINE__ @@ -7997,7 +7997,7 @@ static char *cmd_userset(PGconn *conn, char *cmd, char *id, } } else { if (strcasecmp(transfer_data(i_passwordhash), - users->passwordhash) == 0) { + users->passwordhash)) { reason = "Incorrect password"; goto struckout; }