From e5c320c577d1e5b7f1a44cf5764424e129f05948 Mon Sep 17 00:00:00 2001 From: kanoi Date: Sun, 31 Aug 2014 14:18:10 +1000 Subject: [PATCH] ckdb - pplns error if diff_want < 1 --- src/ckdb.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ckdb.c b/src/ckdb.c index ea3c723e..ca013c04 100644 --- a/src/ckdb.c +++ b/src/ckdb.c @@ -8580,6 +8580,13 @@ static char *cmd_pplns(__maybe_unused PGconn *conn, char *cmd, char *id, hex2bin(ndiffbin, DATA_WORKINFO(w_item)->bits, 4); ndiff = diff_from_nbits(ndiffbin); diff_want = ndiff * diff_times + diff_add; + if (diff_want < 1.0) { + snprintf(reply, siz, + "ERR.invalid diff_want result %f", + diff_want); + return strdup(reply); + } + begin_workinfoid = 0; share_count = 0; total = 0; @@ -8614,7 +8621,7 @@ static char *cmd_pplns(__maybe_unused PGconn *conn, char *cmd, char *id, break; default: snprintf(reply, siz, - "ERR.sharesummary not ready in workinfo %"PRId64, + "ERR.sharesummary1 not ready in workinfo %"PRId64, DATA_SHARESUMMARY(ss_item)->workinfoid); goto shazbot; } @@ -8639,7 +8646,7 @@ static char *cmd_pplns(__maybe_unused PGconn *conn, char *cmd, char *id, break; default: snprintf(reply, siz, - "ERR.sharesummary not ready in workinfo %"PRId64, + "ERR.sharesummary2 not ready in workinfo %"PRId64, DATA_SHARESUMMARY(ss_item)->workinfoid); goto shazbot; }