Browse Source

ckdb/php - add display format block hash to pblocks csv

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

11
pool/page_blocks.php

@ -58,6 +58,7 @@ function doblocks($data, $user)
{
$pg .= "<table callpadding=0 cellspacing=0 border=0>\n";
$pg .= "<tr class=title>";
$pg .= "<td class=dr>#</td>";
$pg .= "<td class=dl>Height</td>";
if ($user !== null)
$pg .= "<td class=dl>Who</td>";
@ -65,7 +66,7 @@ function doblocks($data, $user)
$pg .= "<td class=dc>When</td>";
$pg .= "<td class=dr>Status</td>";
$pg .= "<td class=dr>Diff</td>";
$pg .= "<td class=dr>%</td>";
$pg .= "<td class=dr>Diff%</td>";
$pg .= "<td class=dr>CDF</td>";
$pg .= "</tr>\n";
}
@ -73,12 +74,13 @@ function doblocks($data, $user)
$nettot = 0;
$i = 0;
$orph = false;
$csv = "Height,Status,Timestamp,DiffAcc,NetDiff\n";
$csv = "Sequence,Height,Status,Timestamp,DiffAcc,NetDiff,Hash\n";
if ($ans['STATUS'] == 'ok')
{
$count = $ans['rows'];
for ($i = 0; $i < $count; $i++)
{
$seq = $count - $i;
if (($i % 2) == 0)
$row = 'even';
else
@ -142,6 +144,7 @@ function doblocks($data, $user)
if ($wantcsv === false)
{
$pg .= "<tr class=$row>";
$pg .= "<td class=dr$ex>$seq</td>";
$pg .= "<td class=dl$ex>$hifld</td>";
if ($user !== null)
$pg .= "<td class=dl$ex>".htmlspecialchars($ans['workername:'.$i]).'</td>';
@ -155,11 +158,13 @@ function doblocks($data, $user)
}
else
{
$csv .= "$seq,";
$csv .= "$hi,";
$csv .= "\"$stat\",";
$csv .= $ans['firstcreatedate:'.$i].',';
$csv .= "$diffacc,";
$csv .= "$netdiff\n";
$csv .= "$netdiff,";
$csv .= $ans['blockhash:'.$i]."\n";
}
}
}

2
src/ckdb.h

@ -52,7 +52,7 @@
#define DB_VLOCK "1"
#define DB_VERSION "0.9.6"
#define CKDB_VERSION DB_VERSION"-0.781"
#define CKDB_VERSION DB_VERSION"-0.782"
#define WHERE_FFL " - from %s %s() line %d"
#define WHERE_FFL_HERE __FILE__, __func__, __LINE__

2
src/ckdb_cmd.c

@ -836,7 +836,7 @@ static char *cmd_blocklist(__maybe_unused PGconn *conn, char *cmd, char *id,
snprintf(tmp, sizeof(tmp), "height:%d=%s%c", rows, reply, FLDSEP);
APPEND_REALLOC(buf, off, len, tmp);
str_to_buf(blocks->blockhash, reply, sizeof(reply));
dbhash2btchash(blocks->blockhash, reply, sizeof(reply));
snprintf(tmp, sizeof(tmp), "blockhash:%d=%s%c", rows, reply, FLDSEP);
APPEND_REALLOC(buf, off, len, tmp);

Loading…
Cancel
Save