From 39f4fe06ceceed1b6bfb95efa5353ccbef0e7aa4 Mon Sep 17 00:00:00 2001 From: kanoi Date: Tue, 27 Jan 2015 08:21:46 +1100 Subject: [PATCH 1/3] php - display pool uptime on Pool->Stats --- pool/page_stats.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pool/page_stats.php b/pool/page_stats.php index 90768813..6c44c3ed 100644 --- a/pool/page_stats.php +++ b/pool/page_stats.php @@ -15,6 +15,13 @@ function dostats($data, $user) if (isset($data['info']) && $data['info'] !== false) { $info = $data['info']; + + if (isset($info['p_elapsed'])) + { + $dspel = howlongago($info['p_elapsed']); + $pg .= "Pool Uptime: $dspel
"; + } + $dsp = '?THs'; $dsp5m = '?THs'; $dsp1hr = '?THs'; From 7101cf74eae28a6236f8329a5018a24a6622e22f Mon Sep 17 00:00:00 2001 From: kanoi Date: Tue, 27 Jan 2015 08:58:18 +1100 Subject: [PATCH 2/3] ckdb - remove duplicate variables --- src/ckdb.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/ckdb.c b/src/ckdb.c index 6cb14b17..341cc4e4 100644 --- a/src/ckdb.c +++ b/src/ckdb.c @@ -170,14 +170,6 @@ const char *hashpatt = "^[A-Fa-f0-9]*$"; * bitcoind is used to fully validate them when required */ const char *addrpatt = "^[13][A-HJ-NP-Za-km-z1-9]*$"; -/* These are included in cmd_homepage - * to help identify when ckpool locks up (or dies) */ -tv_t last_heartbeat; -tv_t last_workinfo; -tv_t last_share; -tv_t last_auth; -cklock_t last_lock; - // So the records below have the same 'name' as the klist const char Transfer[] = "Transfer"; @@ -294,6 +286,7 @@ tv_t last_heartbeat; tv_t last_workinfo; tv_t last_share; tv_t last_auth; +cklock_t last_lock; static cklock_t fpm_lock; static char *first_pool_message; From 0e2a690e97d24e24229729fe26fbc6e6b7a62404 Mon Sep 17 00:00:00 2001 From: kanoi Date: Tue, 27 Jan 2015 09:32:16 +1100 Subject: [PATCH 3/3] ckdb - remove compile warning --- src/ckdb.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ckdb.c b/src/ckdb.c index 341cc4e4..3b197309 100644 --- a/src/ckdb.c +++ b/src/ckdb.c @@ -1240,7 +1240,7 @@ static enum cmd_values breakdown(K_TREE **trf_root, K_STORE **trf_store, char reply[1024] = ""; TRANSFER *transfer; K_TREE_CTX ctx[1]; - K_ITEM *item; + K_ITEM *item = NULL; char *cmdptr, *idptr, *next, *eq, *end, *was; char *data = NULL, *tmp; bool noid = false; @@ -1462,9 +1462,11 @@ static enum cmd_values breakdown(K_TREE **trf_root, K_STORE **trf_store, JSON_END, tmp = safe_text(next)); free(tmp); free(cmdptr); - K_WLOCK(transfer_free); - k_add_head(transfer_free, item); - K_WUNLOCK(transfer_free); + if (item) { + K_WLOCK(transfer_free); + k_add_head(transfer_free, item); + K_WUNLOCK(transfer_free); + } return CMD_REPLY; } } else {