19 lines
493 B
Rust
19 lines
493 B
Rust
|
|
use crate::records::ip_score::enums::InfractionType;
|
||
|
|
use crate::records::ip_score::score::update_ip_score;
|
||
|
|
use crate::records::memory::enums::ClientType;
|
||
|
|
use crate::sled::Db;
|
||
|
|
use crate::Utc;
|
||
|
|
|
||
|
|
pub async fn record(ip: &str, client_type: ClientType, db: &Db, wallet_key: &str) {
|
||
|
|
let now = Utc::now().timestamp() as u32;
|
||
|
|
let _ = update_ip_score(
|
||
|
|
ip,
|
||
|
|
client_type.as_str(),
|
||
|
|
InfractionType::BadRpcCall,
|
||
|
|
now,
|
||
|
|
db,
|
||
|
|
wallet_key,
|
||
|
|
)
|
||
|
|
.await;
|
||
|
|
}
|