tari
tari copied to clipboard
Replace Minimized with DisconnectReason in comms
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 https://github.com/tari-project/tari/pull/6307#discussion_r1596245589