mirror of
https://github.com/scsibug/nostr-rs-relay.git
synced 2024-11-22 00:59:07 -05:00
improvement: log blacklisted events
This commit is contained in:
parent
f543957b34
commit
13cc24b5cd
13
src/db.rs
13
src/db.rs
|
@ -210,8 +210,8 @@ pub async fn db_writer(
|
||||||
// TODO: incorporate delegated pubkeys
|
// TODO: incorporate delegated pubkeys
|
||||||
// if the event address is not in allowed_addrs.
|
// if the event address is not in allowed_addrs.
|
||||||
if !allowed_addrs.contains(&event.pubkey) {
|
if !allowed_addrs.contains(&event.pubkey) {
|
||||||
info!(
|
debug!(
|
||||||
"Rejecting event {}, unauthorized author",
|
"rejecting event: {}, unauthorized author",
|
||||||
event.get_event_id_prefix()
|
event.get_event_id_prefix()
|
||||||
);
|
);
|
||||||
notice_tx
|
notice_tx
|
||||||
|
@ -228,9 +228,10 @@ pub async fn db_writer(
|
||||||
let kinds_blacklist = &settings.limits.event_kind_blacklist.clone();
|
let kinds_blacklist = &settings.limits.event_kind_blacklist.clone();
|
||||||
if let Some(event_kind_blacklist) = kinds_blacklist {
|
if let Some(event_kind_blacklist) = kinds_blacklist {
|
||||||
if event_kind_blacklist.contains(&event.kind) {
|
if event_kind_blacklist.contains(&event.kind) {
|
||||||
info!(
|
debug!(
|
||||||
"Rejecting event {}, blacklisted kind",
|
"rejecting event: {}, blacklisted kind: {}",
|
||||||
&event.get_event_id_prefix()
|
&event.get_event_id_prefix(),
|
||||||
|
&event.kind
|
||||||
);
|
);
|
||||||
notice_tx
|
notice_tx
|
||||||
.try_send(Notice::blocked(
|
.try_send(Notice::blocked(
|
||||||
|
@ -314,7 +315,7 @@ pub async fn db_writer(
|
||||||
notice_tx.try_send(Notice::duplicate(event.id)).ok();
|
notice_tx.try_send(Notice::duplicate(event.id)).ok();
|
||||||
} else {
|
} else {
|
||||||
info!(
|
info!(
|
||||||
"persisted event: {:?} (kind={}) from: {:?} in: {:?}",
|
"persisted event: {:?} (kind: {}) from: {:?} in: {:?}",
|
||||||
event.get_event_id_prefix(),
|
event.get_event_id_prefix(),
|
||||||
event.kind,
|
event.kind,
|
||||||
event.get_author_prefix(),
|
event.get_author_prefix(),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user