fix p2p ban types

This commit is contained in:
hinto.janai 2024-10-04 16:25:48 -04:00
parent aaed13ad69
commit 4f9c5f12ab
No known key found for this signature in database
GPG key ID: D47CE05FA175A499

View file

@ -6,14 +6,18 @@ use crate::NetZoneAddress;
/// Data within [`crate::services::AddressBookRequest::SetBan`]. /// Data within [`crate::services::AddressBookRequest::SetBan`].
pub struct SetBan<A: NetZoneAddress> { pub struct SetBan<A: NetZoneAddress> {
/// Address of the peer.
pub address: A, pub address: A,
pub ban: bool, /// - If [`Some`], how long this peer should be banned for
pub duration: Duration, /// - If [`None`], the peer will be unbanned
pub ban: Option<Duration>,
} }
/// Data within [`crate::services::AddressBookResponse::GetBans`]. /// Data within [`crate::services::AddressBookResponse::GetBans`].
pub struct BanState<A: NetZoneAddress> { pub struct BanState<A: NetZoneAddress> {
/// Address of the peer.
pub address: A, pub address: A,
pub banned: bool, /// - If [`Some`], when this peer will be unbanned
pub unban_instant: Instant, /// - If [`None`], the peer is not currently banned
pub unban_instant: Option<Instant>,
} }