diff --git a/p2p/p2p-core/src/ban.rs b/p2p/p2p-core/src/ban.rs index 38db41f..c3b17a4 100644 --- a/p2p/p2p-core/src/ban.rs +++ b/p2p/p2p-core/src/ban.rs @@ -6,14 +6,18 @@ use crate::NetZoneAddress; /// Data within [`crate::services::AddressBookRequest::SetBan`]. pub struct SetBan { + /// Address of the peer. pub address: A, - pub ban: bool, - pub duration: Duration, + /// - If [`Some`], how long this peer should be banned for + /// - If [`None`], the peer will be unbanned + pub ban: Option, } /// Data within [`crate::services::AddressBookResponse::GetBans`]. pub struct BanState { + /// Address of the peer. pub address: A, - pub banned: bool, - pub unban_instant: Instant, + /// - If [`Some`], when this peer will be unbanned + /// - If [`None`], the peer is not currently banned + pub unban_instant: Option, }