Skip to content

Commit

Permalink
Fix check
Browse files Browse the repository at this point in the history
  • Loading branch information
howardwu committed Jan 15, 2022
1 parent e7d0fd7 commit 0b68ab5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion storage/src/helpers/block_locators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl<N: Network> BlockLocators<N> {
pub fn from(block_locators: BTreeMap<u32, (N::BlockHash, Option<BlockHeader<N>>)>) -> Result<Self> {
// Check that the number of block_locators is greater than 0 and less than the MAXIMUM_BLOCK_LOCATORS.
let num_locators = block_locators.len();
match num_locators == 0 || num_locators > MAXIMUM_BLOCK_LOCATORS as usize {
match num_locators > 0 && num_locators <= MAXIMUM_BLOCK_LOCATORS as usize {
true => Ok(Self { block_locators }),
false => {
let error = format!(
Expand Down

0 comments on commit 0b68ab5

Please sign in to comment.