mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 11:31:08 +03:00
Get the sumtree roots outside of an extension
This commit is contained in:
parent
68cfbbecad
commit
17837b9199
1 changed files with 23 additions and 0 deletions
|
@ -98,6 +98,29 @@ impl SumTrees {
|
||||||
Err(e) => Err(Error::StoreErr(e, "sumtree unspent check".to_owned())),
|
Err(e) => Err(Error::StoreErr(e, "sumtree unspent check".to_owned())),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get sum tree roots
|
||||||
|
pub fn roots(
|
||||||
|
&mut self,
|
||||||
|
) -> (HashSum<SumCommit>, HashSum<NoSum<RangeProof>>, HashSum<NoSum<TxKernel>>) {
|
||||||
|
let output_pmmr = PMMR::at(
|
||||||
|
&mut self.output_pmmr_h.backend,
|
||||||
|
self.output_pmmr_h.last_pos,
|
||||||
|
);
|
||||||
|
let rproof_pmmr = PMMR::at(
|
||||||
|
&mut self.rproof_pmmr_h.backend,
|
||||||
|
self.rproof_pmmr_h.last_pos,
|
||||||
|
);
|
||||||
|
let kernel_pmmr = PMMR::at(
|
||||||
|
&mut self.kernel_pmmr_h.backend,
|
||||||
|
self.kernel_pmmr_h.last_pos,
|
||||||
|
);
|
||||||
|
(
|
||||||
|
output_pmmr.root(),
|
||||||
|
rproof_pmmr.root(),
|
||||||
|
kernel_pmmr.root(),
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Starts a new unit of work to extend the chain with additional blocks,
|
/// Starts a new unit of work to extend the chain with additional blocks,
|
||||||
|
|
Loading…
Reference in a new issue