Browse Source

Merge branch 'master' of bitbucket.org:ckolivas/ckpool

master
Con Kolivas 10 years ago
parent
commit
2f2bcf5b37
  1. 7
      pool/page_stats.php
  2. 13
      src/ckdb.c

7
pool/page_stats.php

@ -15,6 +15,13 @@ function dostats($data, $user)
if (isset($data['info']) && $data['info'] !== false) if (isset($data['info']) && $data['info'] !== false)
{ {
$info = $data['info']; $info = $data['info'];
if (isset($info['p_elapsed']))
{
$dspel = howlongago($info['p_elapsed']);
$pg .= "Pool Uptime: $dspel<br>";
}
$dsp = '?THs'; $dsp = '?THs';
$dsp5m = '?THs'; $dsp5m = '?THs';
$dsp1hr = '?THs'; $dsp1hr = '?THs';

13
src/ckdb.c

@ -170,14 +170,6 @@ const char *hashpatt = "^[A-Fa-f0-9]*$";
* bitcoind is used to fully validate them when required */ * bitcoind is used to fully validate them when required */
const char *addrpatt = "^[13][A-HJ-NP-Za-km-z1-9]*$"; 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 // So the records below have the same 'name' as the klist
const char Transfer[] = "Transfer"; const char Transfer[] = "Transfer";
@ -294,6 +286,7 @@ tv_t last_heartbeat;
tv_t last_workinfo; tv_t last_workinfo;
tv_t last_share; tv_t last_share;
tv_t last_auth; tv_t last_auth;
cklock_t last_lock;
static cklock_t fpm_lock; static cklock_t fpm_lock;
static char *first_pool_message; static char *first_pool_message;
@ -1247,7 +1240,7 @@ static enum cmd_values breakdown(K_TREE **trf_root, K_STORE **trf_store,
char reply[1024] = ""; char reply[1024] = "";
TRANSFER *transfer; TRANSFER *transfer;
K_TREE_CTX ctx[1]; K_TREE_CTX ctx[1];
K_ITEM *item; K_ITEM *item = NULL;
char *cmdptr, *idptr, *next, *eq, *end, *was; char *cmdptr, *idptr, *next, *eq, *end, *was;
char *data = NULL, *tmp; char *data = NULL, *tmp;
bool noid = false; bool noid = false;
@ -1469,9 +1462,11 @@ static enum cmd_values breakdown(K_TREE **trf_root, K_STORE **trf_store,
JSON_END, tmp = safe_text(next)); JSON_END, tmp = safe_text(next));
free(tmp); free(tmp);
free(cmdptr); free(cmdptr);
if (item) {
K_WLOCK(transfer_free); K_WLOCK(transfer_free);
k_add_head(transfer_free, item); k_add_head(transfer_free, item);
K_WUNLOCK(transfer_free); K_WUNLOCK(transfer_free);
}
return CMD_REPLY; return CMD_REPLY;
} }
} else { } else {

Loading…
Cancel
Save