fix: enhance event rejection policies and apply sane defaults

This commit is contained in:
2026-01-21 23:24:59 +01:00
parent fc677ae4de
commit 0c20510928

View File

@@ -97,7 +97,14 @@ func main() {
relay.DeleteEvent = append(relay.DeleteEvent, db.DeleteEvent)
relay.ReplaceEvent = append(relay.ReplaceEvent, db.ReplaceEvent)
relay.RejectEvent = append(relay.RejectEvent, policies.ValidateKind, policies.PreventTimestampsInThePast(600), policies.PreventTimestampsInTheFuture(60))
relay.RejectEvent = append(
relay.RejectEvent,
policies.ValidateKind,
policies.PreventTimestampsInThePast(600),
policies.PreventTimestampsInTheFuture(60),
)
policies.ApplySaneDefaults(relay)
relay.RejectEvent = append(relay.RejectEvent,
func(ctx context.Context, event *nostr.Event) (reject bool, msg string) {