replaced match with if to shorten the code
This commit is contained in:
parent
1cc719d413
commit
1481f3f477
@ -488,9 +488,7 @@ impl BlockChain {
|
|||||||
hash: hash,
|
hash: hash,
|
||||||
number: number,
|
number: number,
|
||||||
total_difficulty: total_difficulty,
|
total_difficulty: total_difficulty,
|
||||||
location: match is_new_best {
|
location: if is_new_best {
|
||||||
false => BlockLocation::Branch,
|
|
||||||
true => {
|
|
||||||
// on new best block we need to make sure that all ancestors
|
// on new best block we need to make sure that all ancestors
|
||||||
// are moved to "canon chain"
|
// are moved to "canon chain"
|
||||||
// find the route between old best block and the new one
|
// find the route between old best block and the new one
|
||||||
@ -506,7 +504,8 @@ impl BlockChain {
|
|||||||
route: route.blocks.into_iter().skip(route.index).collect()
|
route: route.blocks.into_iter().skip(route.index).collect()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
BlockLocation::Branch
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user