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`].
pub struct SetBan<A: NetZoneAddress> {
/// 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<Duration>,
}
/// Data within [`crate::services::AddressBookResponse::GetBans`].
pub struct BanState<A: NetZoneAddress> {
/// 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<Instant>,
}