File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
crates/net/network/src/fetch Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -399,7 +399,7 @@ impl Peer {
399399 /// 2. None can fully cover the range, but this peer has lower start value
400400 /// 3. If a peer doesnt announce a range we assume it has full history, but check the other's
401401 /// range and treat that as better if it can cover the range
402- fn has_better_range ( & self , other : & Self , range : RangeInclusive < u64 > ) -> bool {
402+ fn has_better_range ( & self , other : & Self , range : & RangeInclusive < u64 > ) -> bool {
403403 let self_range = self . range ( ) ;
404404 let other_range = other. range ( ) ;
405405
@@ -438,9 +438,7 @@ impl Peer {
438438 fn is_better ( & self , other : & Self , requirement : & BestPeerRequirements ) -> bool {
439439 match requirement {
440440 BestPeerRequirements :: None => false ,
441- BestPeerRequirements :: FullBlockRange ( range) => {
442- self . has_better_range ( other, range. clone ( ) )
443- }
441+ BestPeerRequirements :: FullBlockRange ( range) => self . has_better_range ( other, range) ,
444442 BestPeerRequirements :: FullBlock => self . has_full_history ( ) && !other. has_full_history ( ) ,
445443 }
446444 }
You can’t perform that action at this time.
0 commit comments