Function nakamoto_common::block::locators_indexes
source · pub fn locators_indexes(from: Height) -> Vec<Height>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
Expand description
Get the locator indexes starting from a given height, and going backwards, exponentially backing off.
use nakamoto_common::block;
assert_eq!(block::locators_indexes(0), vec![0]);
assert_eq!(block::locators_indexes(8), vec![8, 7, 6, 5, 4, 3, 2, 1, 0]);
assert_eq!(block::locators_indexes(99), vec![
99, 98, 97, 96, 95, 94, 93, 92, 91, 89, 85, 77, 61, 29, 0
]);