Merge pull request #124 from stoffu/diff-pow

Add PoW and difficulty to block info page
master
moneroexamples 7 years ago committed by GitHub
commit 3bf79c0a8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1175,6 +1175,10 @@ public:
_blk_height, current_blockchain_height);
// initalise page tempate map with basic info about blockchain
string blk_pow_hash_str = pod_to_hex(get_block_longhash(blk, _blk_height));
uint64_t blk_difficulty = core_storage->get_db().get_block_difficulty(_blk_height);
mstch::map context {
{"testnet" , testnet},
{"stagenet" , stagenet},
@ -1192,6 +1196,8 @@ public:
{"blk_age" , age.first},
{"delta_time" , delta_time},
{"blk_nonce" , blk.nonce},
{"blk_pow_hash" , blk_pow_hash_str},
{"blk_difficulty" , blk_difficulty},
{"age_format" , age.second},
{"major_ver" , std::to_string(blk.major_version)},
{"minor_ver" , std::to_string(blk.minor_version)},

@ -30,6 +30,11 @@
<td>Total fees:</td><td>{{sum_fees}}</td>
<td>No of txs:</td><td>{{no_txs}}</td>
</tr>
<tr>
<td>PoW hash:</td><td>{{blk_pow_hash}}</td>
<td>Difficulty:</td><td>{{blk_difficulty}}</td>
<td></td>
</tr>
</table>
<h3>Miner reward transaction</h3>

Loading…
Cancel
Save