Closed alexgleason closed 4 months ago
NIP-01 says this about replaceable events:
In case of replaceable events with the same timestamp, the event with the lowest id (first in lexical order) should be retained, and the other discarded.
Does this match your function?
Yes it does :+1: Cool.
Adds a function to sort events, which is often needed when gathering events from untrusted sources such as relays.
Events are sorted reverse-chronologically by the
created_at
timestamp. If there is a tie withcreated_at
, it sorts lexicographically by the event ID.