Browse Source

ckdb/php - pass statsconfirmed to php to flag estimate stats

master
kanoi 10 years ago
parent
commit
1e68c2d602
  1. 14
      pool/page_blocks.php
  2. 2
      src/ckdb.h
  3. 11
      src/ckdb_cmd.c

14
pool/page_blocks.php

@ -182,6 +182,12 @@ function doblocks($data, $user)
if ($stat == 'Orphan') if ($stat == 'Orphan')
$stara = '<span class=st1>*</span>'; $stara = '<span class=st1>*</span>';
$statsconf = $ans['statsconf:'.$i];
if ($statsconf == 'Y')
$approx = '';
else
$approx = '~';
$diffacc = $ans['diffacc:'.$i]; $diffacc = $ans['diffacc:'.$i];
$acc = number_format($diffacc, 0); $acc = number_format($diffacc, 0);
@ -200,7 +206,7 @@ function doblocks($data, $user)
if ($stat != 'Orphan') if ($stat != 'Orphan')
$nettot += $netdiff; $nettot += $netdiff;
$cdfdsp = number_format($cdf, 2); $cdfdsp = number_format($cdf, 3);
} }
else else
{ {
@ -218,9 +224,9 @@ function doblocks($data, $user)
$pg .= "<td class=dl$ex>".htmlspecialchars($ans['workername:'.$i]).'</td>'; $pg .= "<td class=dl$ex>".htmlspecialchars($ans['workername:'.$i]).'</td>';
$pg .= "<td class=dr$ex>".btcfmt($ans['reward:'.$i]).'</td>'; $pg .= "<td class=dr$ex>".btcfmt($ans['reward:'.$i]).'</td>';
$pg .= "<td class=dl$ex>".utcd($ans['firstcreatedate:'.$i]).'</td>'; $pg .= "<td class=dl$ex>".utcd($ans['firstcreatedate:'.$i]).'</td>';
$pg .= "<td class=dr$ex>".$stat.'</td>'; $pg .= "<td class=dr$ex>$stat</td>";
$pg .= "<td class=dr>$stara$acc</td>"; $pg .= "<td class=dr>$stara$approx$acc</td>";
$pg .= "<td class=dr$bg>$bpct</td>"; $pg .= "<td class=dr$bg>$approx$bpct</td>";
$pg .= "<td class=dr>$cdfdsp</td>"; $pg .= "<td class=dr>$cdfdsp</td>";
$pg .= "</tr>\n"; $pg .= "</tr>\n";
} }

2
src/ckdb.h

@ -55,7 +55,7 @@
#define DB_VLOCK "1" #define DB_VLOCK "1"
#define DB_VERSION "1.0.0" #define DB_VERSION "1.0.0"
#define CKDB_VERSION DB_VERSION"-1.031" #define CKDB_VERSION DB_VERSION"-1.032"
#define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL " - from %s %s() line %d"
#define WHERE_FFL_HERE __FILE__, __func__, __LINE__ #define WHERE_FFL_HERE __FILE__, __func__, __LINE__

11
src/ckdb_cmd.c

@ -902,6 +902,11 @@ redo:
blocks_confirmed(blocks->confirmed), FLDSEP); blocks_confirmed(blocks->confirmed), FLDSEP);
APPEND_REALLOC(buf, off, len, tmp); APPEND_REALLOC(buf, off, len, tmp);
snprintf(tmp, sizeof(tmp),
"statsconf:%d=%s%c", rows,
blocks->statsconfirmed, FLDSEP);
APPEND_REALLOC(buf, off, len, tmp);
double_to_buf(blocks->diffacc, reply, sizeof(reply)); double_to_buf(blocks->diffacc, reply, sizeof(reply));
snprintf(tmp, sizeof(tmp), "diffacc:%d=%s%c", rows, reply, FLDSEP); snprintf(tmp, sizeof(tmp), "diffacc:%d=%s%c", rows, reply, FLDSEP);
APPEND_REALLOC(buf, off, len, tmp); APPEND_REALLOC(buf, off, len, tmp);
@ -1016,8 +1021,8 @@ redo:
"rows=%d%cflds=%s%c", "rows=%d%cflds=%s%c",
rows, FLDSEP, rows, FLDSEP,
"seq,height,blockhash,nonce,reward,workername,firstcreatedate," "seq,height,blockhash,nonce,reward,workername,firstcreatedate,"
"createdate,status,diffacc,diffinv,shareacc,shareinv,elapsed," "createdate,status,statsconf,diffacc,diffinv,shareacc,"
"netdiff,diffratio,cdf,luck", FLDSEP); "shareinv,elapsed,netdiff,diffratio,cdf,luck", FLDSEP);
APPEND_REALLOC(buf, off, len, tmp); APPEND_REALLOC(buf, off, len, tmp);
snprintf(tmp, sizeof(tmp), "arn=%s%carp=%s", "Blocks,BlockStats", FLDSEP, ",s"); snprintf(tmp, sizeof(tmp), "arn=%s%carp=%s", "Blocks,BlockStats", FLDSEP, ",s");
@ -5446,7 +5451,7 @@ struct CMDS ckdb_cmds[] = {
{ CMD_WORKERSTAT,"workerstats", false, true, cmd_workerstats,ACCESS_POOL }, { CMD_WORKERSTAT,"workerstats", false, true, cmd_workerstats,ACCESS_POOL },
{ CMD_BLOCK, "block", false, true, cmd_blocks, ACCESS_POOL }, { CMD_BLOCK, "block", false, true, cmd_blocks, ACCESS_POOL },
{ CMD_BLOCKLIST,"blocklist", false, false, cmd_blocklist, ACCESS_WEB }, { CMD_BLOCKLIST,"blocklist", false, false, cmd_blocklist, ACCESS_WEB },
{ CMD_BLOCKSTATUS,"blockstatus",false, false, cmd_blockstatus,ACCESS_WEB }, { CMD_BLOCKSTATUS,"blockstatus",false, false, cmd_blockstatus,ACCESS_SYSTEM },
{ CMD_NEWID, "newid", false, false, cmd_newid, ACCESS_SYSTEM }, { CMD_NEWID, "newid", false, false, cmd_newid, ACCESS_SYSTEM },
{ CMD_PAYMENTS, "payments", false, false, cmd_payments, ACCESS_WEB }, { CMD_PAYMENTS, "payments", false, false, cmd_payments, ACCESS_WEB },
{ CMD_WORKERS, "workers", false, false, cmd_workers, ACCESS_WEB }, { CMD_WORKERS, "workers", false, false, cmd_workers, ACCESS_WEB },

Loading…
Cancel
Save