File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -237,7 +237,7 @@ impl Desegmenter {
237
237
// Quick root check first:
238
238
{
239
239
let txhashset = self . txhashset . read ( ) ;
240
- txhashset. roots ( ) . validate ( & self . archive_header ) ?;
240
+ txhashset. roots ( ) ? . validate ( & self . archive_header ) ?;
241
241
}
242
242
243
243
// TODO: Possibly Keep track of this in the DB so we can pick up where we left off if needed
Original file line number Diff line number Diff line change @@ -479,19 +479,19 @@ impl TxHashSet {
479
479
}
480
480
481
481
/// Get MMR roots.
482
- pub fn roots ( & self ) -> TxHashSetRoots {
482
+ pub fn roots ( & self ) -> Result < TxHashSetRoots , Error > {
483
483
let output_pmmr = ReadonlyPMMR :: at ( & self . output_pmmr_h . backend , self . output_pmmr_h . size ) ;
484
484
let rproof_pmmr = ReadonlyPMMR :: at ( & self . rproof_pmmr_h . backend , self . rproof_pmmr_h . size ) ;
485
485
let kernel_pmmr = ReadonlyPMMR :: at ( & self . kernel_pmmr_h . backend , self . kernel_pmmr_h . size ) ;
486
486
487
- TxHashSetRoots {
487
+ Ok ( TxHashSetRoots {
488
488
output_roots : OutputRoots {
489
- pmmr_root : output_pmmr. root ( ) . expect ( "no root, invalid tree" ) ,
489
+ pmmr_root : output_pmmr. root ( ) . map_err ( |_| Error :: InvalidRoot ) ? ,
490
490
bitmap_root : self . bitmap_accumulator . root ( ) ,
491
491
} ,
492
- rproof_root : rproof_pmmr. root ( ) . expect ( "no root, invalid tree" ) ,
493
- kernel_root : kernel_pmmr. root ( ) . expect ( "no root, invalid tree" ) ,
494
- }
492
+ rproof_root : rproof_pmmr. root ( ) . map_err ( |_| Error :: InvalidRoot ) ? ,
493
+ kernel_root : kernel_pmmr. root ( ) . map_err ( |_| Error :: InvalidRoot ) ? ,
494
+ } )
495
495
}
496
496
497
497
/// Return Commit's MMR position
Original file line number Diff line number Diff line change @@ -238,7 +238,7 @@ impl DesegmenterRequestor {
238
238
}
239
239
240
240
pub fn check_roots ( & self ) {
241
- let roots = self . chain . txhashset ( ) . read ( ) . roots ( ) ;
241
+ let roots = self . chain . txhashset ( ) . read ( ) . roots ( ) . unwrap ( ) ;
242
242
let archive_header = self . chain . txhashset_archive_header_header_only ( ) . unwrap ( ) ;
243
243
debug ! ( "Archive Header is {:?}" , archive_header) ;
244
244
debug ! ( "TXHashset output root is {:?}" , roots) ;
You can’t perform that action at this time.
0 commit comments