mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 02:07:56 +00:00
Light client integration tests (#2638)
* add light nodes to test_sync && test_consensus * forbid light2light connections * add light nodes to test_connectivity * fixed light2light connection penalty * post-merge fixes * remove best_queued from Client info
This commit is contained in:
committed by
Gavin Wood
parent
67bdfc7d8e
commit
fc7548ce27
@@ -845,13 +845,22 @@ impl<B: BlockT, S: NetworkSpecialization<B>, H: ExHashT> Protocol<B, S, H> {
|
||||
network_out.disconnect_peer(who);
|
||||
return;
|
||||
}
|
||||
|
||||
if self.config.roles.is_light() {
|
||||
// we're not interested in light peers
|
||||
if status.roles.is_light() {
|
||||
debug!(target: "sync", "Peer {} is unable to serve light requests", who);
|
||||
network_out.report_peer(who.clone(), i32::min_value());
|
||||
network_out.disconnect_peer(who);
|
||||
return;
|
||||
}
|
||||
|
||||
// we don't interested in peers that are far behind us
|
||||
let self_best_block = self
|
||||
.context_data
|
||||
.chain
|
||||
.info()
|
||||
.best_queued_number
|
||||
.unwrap_or_else(|| Zero::zero());
|
||||
.chain.best_number;
|
||||
let blocks_difference = self_best_block
|
||||
.checked_sub(&status.best_number)
|
||||
.unwrap_or_else(Zero::zero)
|
||||
|
||||
Reference in New Issue
Block a user