[testnet2] Store output sum (#1043)

* block sums and reworked block validation
read and write block_sums
refactor validate on both block and txhashset
write block_sum on fast sync
we store the kernel_sum (need to account for the offset)

* block_sums

* rustfmt

* cleanup
This commit is contained in:
Antioch Peverell
2018-05-07 09:21:41 -04:00
committed by GitHub
parent b42b2a4f77
commit 4dd94ff39e
13 changed files with 426 additions and 141 deletions
+8
View File
@@ -32,3 +32,11 @@ pub fn static_secp_instance() -> Arc<Mutex<secp::Secp256k1>> {
secp_inst.randomize(&mut thread_rng());
SECP256K1.clone()
}
// TODO - Can we generate this once and memoize it for subsequent use?
// Even if we clone it each time it will likely be faster than this.
pub fn commit_to_zero_value() -> secp::pedersen::Commitment {
let secp = static_secp_instance();
let secp = secp.lock().unwrap();
secp.commit_value(0).unwrap()
}