mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 22:47:56 +00:00
Ensure the listen addresses are consistent with the transport (#6436)
* Initial commit
Forked at: 82bdf1a891
No parent branch.
* Ensure the listen addresses are consistent with the transport
* Update client/network/src/error.rs
* Update client/network/src/service.rs
* Better implementation
* Fix bad previous impl
* add boot_nodes
* reserved nodes
* test boot nodes
* reserved nodes tests
* add public_addresses and make specific error type
* Update client/network/src/error.rs
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
//! Substrate network possible errors.
|
||||
|
||||
use crate::config::TransportConfig;
|
||||
use libp2p::{PeerId, Multiaddr};
|
||||
|
||||
use std::fmt;
|
||||
@@ -48,7 +49,18 @@ pub enum Error {
|
||||
second_id: PeerId,
|
||||
},
|
||||
/// Prometheus metrics error.
|
||||
Prometheus(prometheus_endpoint::PrometheusError)
|
||||
Prometheus(prometheus_endpoint::PrometheusError),
|
||||
/// The network addresses are invalid because they don't match the transport.
|
||||
#[display(
|
||||
fmt = "The following addresses are invalid because they don't match the transport: {:?}",
|
||||
addresses,
|
||||
)]
|
||||
AddressesForAnotherTransport {
|
||||
/// Transport used.
|
||||
transport: TransportConfig,
|
||||
/// The invalid addresses.
|
||||
addresses: Vec<Multiaddr>,
|
||||
},
|
||||
}
|
||||
|
||||
// Make `Debug` use the `Display` implementation.
|
||||
@@ -65,6 +77,7 @@ impl std::error::Error for Error {
|
||||
Error::Client(ref err) => Some(err),
|
||||
Error::DuplicateBootnode { .. } => None,
|
||||
Error::Prometheus(ref err) => Some(err),
|
||||
Error::AddressesForAnotherTransport { .. } => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user