Add cuckoo size to block API (#1232)

This commit is contained in:
jaspervdm 2018-07-09 10:14:04 +02:00 committed by Yeastplume
parent d2a5a8ddb3
commit 74f1335bfd

View file

@ -482,6 +482,8 @@ pub struct BlockHeaderPrintable {
pub kernel_root: String, pub kernel_root: String,
/// Nonce increment used to mine this block. /// Nonce increment used to mine this block.
pub nonce: u64, pub nonce: u64,
/// Size of the cuckoo graph
pub cuckoo_size: u8,
/// Total accumulated difficulty since genesis block /// Total accumulated difficulty since genesis block
pub total_difficulty: u64, pub total_difficulty: u64,
/// Total kernel offset since genesis block /// Total kernel offset since genesis block
@ -500,6 +502,7 @@ impl BlockHeaderPrintable {
range_proof_root: util::to_hex(h.range_proof_root.to_vec()), range_proof_root: util::to_hex(h.range_proof_root.to_vec()),
kernel_root: util::to_hex(h.kernel_root.to_vec()), kernel_root: util::to_hex(h.kernel_root.to_vec()),
nonce: h.nonce, nonce: h.nonce,
cuckoo_size: h.pow.cuckoo_sizeshift,
total_difficulty: h.total_difficulty.to_num(), total_difficulty: h.total_difficulty.to_num(),
total_kernel_offset: h.total_kernel_offset.to_hex(), total_kernel_offset: h.total_kernel_offset.to_hex(),
} }