mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-11-09 22:09:06 -05:00
add relay logic
This commit is contained in:
parent
8bef0e9d79
commit
d1b6bdb18e
8
22.md
8
22.md
|
@ -21,3 +21,11 @@ Motivation
|
|||
The motivation for this NIP is to prevent clients from saying they published an event *significantly* earlier than they actually did or saying they published an event in the future.
|
||||
|
||||
The event `created_at` field is just a unix timestamp (integer) so one could set it to a time in the past or future. For example, the `created_at` field could be set to a time 10 years ago even though it was created today and it could still be a valid event. One could also set the `created_at` field to a time 10 years in the future and it could still be a valid event. This NIP aims to set a maximum amount of time elapsed between when an event was created and when it was *actually* published and prevent events from being from the future.
|
||||
|
||||
Relay Logic
|
||||
-----------
|
||||
|
||||
```
|
||||
if time.now - event.created_at > limit OR event.created_at > time.now:
|
||||
send NOTICE
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue
Block a user