cache get_shift() and get_leaf_shift() in prune_list (#1495)

* cache shift and leaf_shift values in prune_list for fast lookup later

* rustfmt

* fixup core tests
This commit is contained in:
Antioch Peverell
2018-09-12 08:19:05 +01:00
committed by GitHub
parent 3eacc06a97
commit 07eefc4d6b
6 changed files with 222 additions and 103 deletions
+7 -1
View File
@@ -869,7 +869,10 @@ impl<'a> Extension<'a> {
debug!(
LOGGER,
"txhashset: validated the output|rproof|kernel mmrs, took {}s",
"txhashset: validated the output {}, rproof {}, kernel {} mmrs, took {}s",
self.output_pmmr.unpruned_size(),
self.rproof_pmmr.unpruned_size(),
self.kernel_pmmr.unpruned_size(),
now.elapsed().as_secs(),
);
@@ -1224,6 +1227,9 @@ fn input_pos_to_rewind(
return Ok(bitmap);
}
//
// TODO - rework this loop to use Bitmap::fast_or() on a vec of bitmaps.
//
loop {
if current == block_header.hash() {
break;