tari-project/tari

Replace Minimized with DisconnectReason in comms

Opened this issue · 0 comments

It appears that this is only used to improve logs.

Not necessary for now but I'd suggest making this a general reason enum (you can use thiserror for the human readable text or impl Display)

#[derive(Debug, Clone, Copy, thiserror::Error)]
pub enum DisconnectReason {
    #[error("Remote disconnected")]
    RemoteDisconnected,
    #[error("Connection was culled because it was inactive")]
    ConnectionCulledInactive, 
     #[error("Connection was culled to reduce number of connections")]
    ConnectionCulledMinimise
    #[error("Local node explicit disconnect")]
    LocalDisconnected
}

Originally posted by @sdbondi in #6307 (comment)