mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 03:21:08 +03:00
Dump sumtrees state on error
This commit is contained in:
parent
8e382a7593
commit
2222b28981
2 changed files with 11 additions and 0 deletions
|
@ -265,6 +265,7 @@ fn validate_block(b: &Block,
|
||||||
if utxo_root.hash != b.header.utxo_root || rproof_root.hash != b.header.range_proof_root ||
|
if utxo_root.hash != b.header.utxo_root || rproof_root.hash != b.header.range_proof_root ||
|
||||||
kernel_root.hash != b.header.kernel_root {
|
kernel_root.hash != b.header.kernel_root {
|
||||||
|
|
||||||
|
ext.dump();
|
||||||
return Err(Error::InvalidRoot);
|
return Err(Error::InvalidRoot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -284,6 +284,16 @@ impl<'a> Extension<'a> {
|
||||||
self.rollback = true;
|
self.rollback = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Dumps the state of the 3 sum trees to stdout for debugging
|
||||||
|
pub fn dump(&self) {
|
||||||
|
println!("-- outputs --");
|
||||||
|
self.output_pmmr.dump();
|
||||||
|
println!("-- range proofs --");
|
||||||
|
self.rproof_pmmr.dump();
|
||||||
|
println!("-- kernels --");
|
||||||
|
self.kernel_pmmr.dump();
|
||||||
|
}
|
||||||
|
|
||||||
// Sizes of the sum trees, used by `extending` on rollback.
|
// Sizes of the sum trees, used by `extending` on rollback.
|
||||||
fn sizes(&self) -> (u64, u64, u64) {
|
fn sizes(&self) -> (u64, u64, u64) {
|
||||||
(self.output_pmmr.unpruned_size(),
|
(self.output_pmmr.unpruned_size(),
|
||||||
|
|
Loading…
Reference in a new issue