From 5143122b82ba833b8ac12576124ebd1d4da599f7 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 28 Feb 2017 17:37:55 +1100 Subject: [PATCH] Remove hard coded ckdb limits. --- src/ckdb.h | 10 ---------- src/ckdb_cmd.c | 18 ++---------------- src/ckdb_data.c | 18 ++---------------- 3 files changed, 4 insertions(+), 42 deletions(-) diff --git a/src/ckdb.h b/src/ckdb.h index cdcf6d3a..00dafab4 100644 --- a/src/ckdb.h +++ b/src/ckdb.h @@ -3283,16 +3283,6 @@ extern void sequence_report(bool lock); // *** ckdb_data.c *** // *** -/* Blocks after 334106 were set to 5xN - * however, they cannot count back to include the workinfoid of 333809 - * due to the markersummaries that were created. - * Code checks that if the block is after FIVExSTT then it must stop - * counting back shares at - and not include - FIVExWID */ -#define FIVExSTT 334106 -#define FIVExLIM 333809 -// 333809 workinfoid -#define FIVExWID 6085620100361140756 - // optioncontrol names for PPLNS N diff calculation #define PPLNSDIFFTIMES "pplns_diff_times" #define PPLNSDIFFADD "pplns_diff_add" diff --git a/src/ckdb_cmd.c b/src/ckdb_cmd.c index b64f2e43..a7c2f098 100644 --- a/src/ckdb_cmd.c +++ b/src/ckdb_cmd.c @@ -4344,7 +4344,7 @@ static char *cmd_pplns(__maybe_unused PGconn *conn, char *cmd, char *id, double diff_times = 1.0; double diff_add = 0.0; double diff_want; - bool allow_aged = false, countbacklimit; + bool allow_aged = false; size_t len, off; int rows; @@ -4443,13 +4443,7 @@ static char *cmd_pplns(__maybe_unused PGconn *conn, char *cmd, char *id, return strdup(reply); } - if (blocks->height > FIVExSTT) - countbacklimit = true; - else - countbacklimit = false; - LOGDEBUG("%s(): ndiff %.0f limit=%s", - __func__, ndiff, - countbacklimit ? "true" : "false"); + LOGDEBUG("%s(): ndiff %.0f", __func__, ndiff); begin_workinfoid = end_workinfoid = 0; total_share_count = acc_share_count = 0; total_diff = 0; @@ -4486,10 +4480,6 @@ static char *cmd_pplns(__maybe_unused PGconn *conn, char *cmd, char *id, share_status = "Not ready1"; } - // Stop before FIVExWID if necessary - if (countbacklimit && sharesummary->workinfoid <= FIVExWID) - break; - ss_count++; total_share_count += sharesummary->sharecount; acc_share_count += sharesummary->shareacc; @@ -4545,10 +4535,6 @@ static char *cmd_pplns(__maybe_unused PGconn *conn, char *cmd, char *id, LOGDEBUG("%s(): workmarkers < %"PRId64, __func__, lookworkmarkers.workinfoidend); while (total_diff < diff_want && wm_item && CURRENT(&(workmarkers->expirydate))) { if (WMPROCESSED(workmarkers->status)) { - // Stop before FIVExWID if necessary - if (countbacklimit && workmarkers->workinfoidstart <= FIVExWID) - break; - wm_count++; lookmarkersummary.markerid = workmarkers->markerid; lookmarkersummary.userid = MAXID; diff --git a/src/ckdb_data.c b/src/ckdb_data.c index d7eba801..6ce63a5e 100644 --- a/src/ckdb_data.c +++ b/src/ckdb_data.c @@ -4555,7 +4555,7 @@ bool process_pplns(int32_t height, char *blockhash, tv_t *addr_cd) { K_TREE_CTX b_ctx[1], ss_ctx[1], wm_ctx[1], ms_ctx[1], pay_ctx[1], mu_ctx[1]; bool allow_aged = true, conned = false, begun = false; - bool countbacklimit, ok = false; + bool ok = false; PGconn *conn = NULL; MININGPAYOUTS *miningpayouts; OPTIONCONTROL *optioncontrol; @@ -4683,13 +4683,7 @@ bool process_pplns(int32_t height, char *blockhash, tv_t *addr_cd) goto oku; } - // Check for the hard coded limit - if (blocks->height > FIVExSTT) - countbacklimit = true; - else - countbacklimit = false; - LOGDEBUG("%s(): ndiff %.1f limit %c", - __func__, ndiff, countbacklimit ? 'Y' : 'N'); + LOGDEBUG("%s(): ndiff %.1f", __func__, ndiff); // add up all the shares ... begin_workinfoid = end_workinfoid = 0; @@ -4743,10 +4737,6 @@ bool process_pplns(int32_t height, char *blockhash, tv_t *addr_cd) goto shazbot; } - // Stop before FIVExWID if necessary - if (countbacklimit && sharesummary->workinfoid <= FIVExWID) - break; - ss_count++; total_share_count += sharesummary->sharecount; acc_share_count += sharesummary->shareacc; @@ -4814,10 +4804,6 @@ bool process_pplns(int32_t height, char *blockhash, tv_t *addr_cd) LOGDEBUG("%s(): workmarkers < %"PRId64, __func__, lookworkmarkers.workinfoidend); while (total_diff < diff_want && wm_item && CURRENT(&(workmarkers->expirydate))) { if (WMPROCESSED(workmarkers->status)) { - // Stop before FIVExWID if necessary - if (countbacklimit && workmarkers->workinfoidstart <= FIVExWID) - break; - wm_count++; lookmarkersummary.markerid = workmarkers->markerid; lookmarkersummary.userid = MAXID;