Hard fork tryout: better PoW encapsulation in block header (#1478)

* Improve encapsulation with ProofOfWork struct
* Add dual pow scaling factor, fix test
* Fix pre_pow serialization, chain tests
* Adjust header serialized size calc
* Hard fork handling, version-based serialization
This commit is contained in:
Ignotus Peverell
2018-09-10 15:36:57 -07:00
committed by GitHub
parent 48857b7e16
commit ecf20602d5
17 changed files with 262 additions and 128 deletions
+4 -4
View File
@@ -521,10 +521,10 @@ impl BlockHeaderPrintable {
output_root: util::to_hex(h.output_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()),
nonce: h.nonce,
cuckoo_size: h.pow.cuckoo_sizeshift,
cuckoo_solution: h.pow.nonces.clone(),
total_difficulty: h.total_difficulty.to_num(),
nonce: h.pow.nonce,
cuckoo_size: h.pow.cuckoo_sizeshift(),
cuckoo_solution: h.pow.proof.nonces.clone(),
total_difficulty: h.pow.total_difficulty.to_num(),
total_kernel_offset: h.total_kernel_offset.to_hex(),
}
}