mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 22:47:56 +00:00
PoV Distribution optimization (#1990)
* Initial commit * Remove unnecessary struct * Some review nits * Update node/network/pov-distribution/src/lib.rs * Update parachain/test-parachains/adder/collator/tests/integration.rs * Review nits * notify_all_we_are_awaiting * Both ways of peers connections should work the same * Add mod-level docs to error.rs * Avoid multiple connection requests at same parent * Dont bail on errors * FusedStream for ConnectionRequests * Fix build after merge * Improve error handling * Remove whitespace formatting
This commit is contained in:
@@ -115,6 +115,12 @@ pub struct ConnectionRequests {
|
||||
requests: StreamUnordered<ConnectionRequest>,
|
||||
}
|
||||
|
||||
impl stream::FusedStream for ConnectionRequests {
|
||||
fn is_terminated(&self) -> bool {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
impl ConnectionRequests {
|
||||
/// Insert a new connection request.
|
||||
///
|
||||
@@ -133,6 +139,11 @@ impl ConnectionRequests {
|
||||
Pin::new(&mut self.requests).remove(token);
|
||||
}
|
||||
}
|
||||
|
||||
/// Is a connection at this relay parent already present in the request
|
||||
pub fn contains_request(&self, relay_parent: &Hash) -> bool {
|
||||
self.id_map.contains_key(relay_parent)
|
||||
}
|
||||
}
|
||||
|
||||
impl stream::Stream for ConnectionRequests {
|
||||
|
||||
Reference in New Issue
Block a user