Fix root scan in ledger tool (#15532)
This commit is contained in:
		@@ -1293,6 +1293,13 @@ fn main() {
 | 
			
		||||
                    .takes_value(true)
 | 
			
		||||
                    .help("Maximum block height")
 | 
			
		||||
            )
 | 
			
		||||
            .arg(
 | 
			
		||||
                Arg::with_name("start_root")
 | 
			
		||||
                    .long("start-root")
 | 
			
		||||
                    .value_name("NUM")
 | 
			
		||||
                    .takes_value(true)
 | 
			
		||||
                    .help("First root to start searching from")
 | 
			
		||||
            )
 | 
			
		||||
            .arg(
 | 
			
		||||
                Arg::with_name("slot_list")
 | 
			
		||||
                    .long("slot-list")
 | 
			
		||||
@@ -2698,6 +2705,11 @@ fn main() {
 | 
			
		||||
            } else {
 | 
			
		||||
                usize::MAX
 | 
			
		||||
            };
 | 
			
		||||
            let start_root = if let Some(height) = arg_matches.value_of("start_root") {
 | 
			
		||||
                Slot::from_str(height).expect("Starting root must be a number")
 | 
			
		||||
            } else {
 | 
			
		||||
                0
 | 
			
		||||
            };
 | 
			
		||||
            let num_roots = if let Some(roots) = arg_matches.value_of("num_roots") {
 | 
			
		||||
                usize::from_str(roots).expect("Number of roots must be a number")
 | 
			
		||||
            } else {
 | 
			
		||||
@@ -2705,7 +2717,7 @@ fn main() {
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            let iter = blockstore
 | 
			
		||||
                .rooted_slot_iterator(0)
 | 
			
		||||
                .rooted_slot_iterator(start_root)
 | 
			
		||||
                .expect("Failed to get rooted slot");
 | 
			
		||||
 | 
			
		||||
            let mut slot_hash = Vec::new();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user