network: add Network::default_port().
This commit is contained in:
parent
9682d452ee
commit
ea6017d0dc
|
@ -11,6 +11,16 @@ pub enum Network {
|
|||
Testnet,
|
||||
}
|
||||
|
||||
impl Network {
|
||||
/// Get the default port associated to this network.
|
||||
pub fn default_port(&self) -> u16 {
|
||||
match self {
|
||||
Network::Mainnet => 8233,
|
||||
Network::Testnet => 18233,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Network {
|
||||
fn default() -> Self {
|
||||
Network::Mainnet
|
||||
|
|
Loading…
Reference in New Issue