mirror of
https://github.com/hinto-janai/cuprate.git
synced 2024-12-23 12:09:57 +00:00
fix p2p ban types
This commit is contained in:
parent
aaed13ad69
commit
4f9c5f12ab
1 changed files with 8 additions and 4 deletions
|
@ -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>,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue