mirror of
https://github.com/hinto-janai/cuprate.git
synced 2024-12-23 03:59:37 +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`].
|
||||
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>,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue