Merge pull request #174 from stoffu/diff-128

support 128 bit difficulty type
master
moneroexamples 6 years ago committed by GitHub
commit ae385ac6b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1291,8 +1291,7 @@ show_block(uint64_t _blk_height)
// initalise page tempate map with basic info about blockchain // initalise page tempate map with basic info about blockchain
string blk_pow_hash_str = pod_to_hex(get_block_longhash(blk, _blk_height)); string blk_pow_hash_str = pod_to_hex(get_block_longhash(blk, _blk_height));
uint64_t blk_difficulty = core_storage->get_db() cryptonote::difficulty_type blk_difficulty = core_storage->get_db().get_block_difficulty(_blk_height);
.get_block_difficulty(_blk_height).convert_to<uint64_t>();
mstch::map context { mstch::map context {
{"testnet" , testnet}, {"testnet" , testnet},
@ -1313,7 +1312,8 @@ show_block(uint64_t _blk_height)
{"delta_time" , delta_time}, {"delta_time" , delta_time},
{"blk_nonce" , blk.nonce}, {"blk_nonce" , blk.nonce},
{"blk_pow_hash" , blk_pow_hash_str}, {"blk_pow_hash" , blk_pow_hash_str},
{"blk_difficulty" , blk_difficulty}, {"blk_difficulty_lo" , (blk_difficulty << 64 >> 64).convert_to<uint64_t>()},
{"blk_difficulty_hi" , (blk_difficulty >> 64).convert_to<uint64_t>()},
{"age_format" , age.second}, {"age_format" , age.second},
{"major_ver" , std::to_string(blk.major_version)}, {"major_ver" , std::to_string(blk.major_version)},
{"minor_ver" , std::to_string(blk.minor_version)}, {"minor_ver" , std::to_string(blk.minor_version)},

@ -32,7 +32,7 @@
</tr> </tr>
<tr> <tr>
<td>PoW hash:</td><td>{{blk_pow_hash}}</td> <td>PoW hash:</td><td>{{blk_pow_hash}}</td>
<td>Difficulty:</td><td>{{blk_difficulty}}</td> <td>Difficulty (hi64, lo64):</td><td>{{blk_difficulty_hi}}, {{blk_difficulty_lo}}</td>
<td></td> <td></td>
</tr> </tr>
</table> </table>

Loading…
Cancel
Save