v0.0.32 - Prevent NIP-17 old message reprocessing by guarding rumor created_at against startup time
This commit is contained in:
@@ -51,11 +51,11 @@ Agents learn capabilities through skills — Nostr events that any agent can di
|
||||
|
||||
Didactyl will support local inference, which is very privacy preserving. Remote inference does however have it's advantages, and in those cases Didactyl supports using Bitcoin Lightning and eCash inference providers.
|
||||
|
||||
## Current Status — v0.0.31
|
||||
## Current Status — v0.0.32
|
||||
|
||||
**Active build — this project is barely working. Experiment at your own risk.**
|
||||
|
||||
> Last release update: v0.0.31 — Fix NIP-17 DM receive by using separate kind4/kind1059 subscriptions and 2-day lookback for gift wraps
|
||||
> Last release update: v0.0.32 — Prevent NIP-17 old message reprocessing by guarding rumor created_at against startup time
|
||||
|
||||
- Connects to configured relays with auto-reconnect and relay state transition logging
|
||||
- Publishes configured startup events per relay as each relay becomes connected
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@
|
||||
// Using DIDACTYL_ prefix to avoid conflicts with nostr_core_lib VERSION macros
|
||||
#define DIDACTYL_VERSION_MAJOR 0
|
||||
#define DIDACTYL_VERSION_MINOR 0
|
||||
#define DIDACTYL_VERSION_PATCH 31
|
||||
#define DIDACTYL_VERSION "v0.0.31"
|
||||
#define DIDACTYL_VERSION_PATCH 32
|
||||
#define DIDACTYL_VERSION "v0.0.32"
|
||||
|
||||
// Agent metadata
|
||||
#define DIDACTYL_NAME "Didactyl"
|
||||
|
||||
+12
-1
@@ -628,14 +628,25 @@ static void on_event(cJSON* event, const char* relay_url, void* user_data) {
|
||||
cJSON* rumor_kind = cJSON_GetObjectItemCaseSensitive(rumor, "kind");
|
||||
cJSON* rumor_pubkey = cJSON_GetObjectItemCaseSensitive(rumor, "pubkey");
|
||||
cJSON* rumor_content = cJSON_GetObjectItemCaseSensitive(rumor, "content");
|
||||
cJSON* rumor_created_at = cJSON_GetObjectItemCaseSensitive(rumor, "created_at");
|
||||
|
||||
if (!rumor_kind || !rumor_pubkey || !rumor_content ||
|
||||
if (!rumor_kind || !rumor_pubkey || !rumor_content || !rumor_created_at ||
|
||||
!cJSON_IsNumber(rumor_kind) || !cJSON_IsString(rumor_pubkey) || !cJSON_IsString(rumor_content) ||
|
||||
!cJSON_IsNumber(rumor_created_at) ||
|
||||
!rumor_pubkey->valuestring || strlen(rumor_pubkey->valuestring) != 64U) {
|
||||
cJSON_Delete(rumor);
|
||||
return;
|
||||
}
|
||||
|
||||
time_t rumor_created_at_ts = (time_t)rumor_created_at->valuedouble;
|
||||
if (rumor_created_at_ts < g_start_time) {
|
||||
DEBUG_TRACE("[didactyl] DEBUG on_event: skipping old NIP-17 rumor created_at=%ld start=%ld",
|
||||
(long)rumor_created_at_ts,
|
||||
(long)g_start_time);
|
||||
cJSON_Delete(rumor);
|
||||
return;
|
||||
}
|
||||
|
||||
int rumor_kind_val = (int)rumor_kind->valuedouble;
|
||||
if (rumor_kind_val != 14 && rumor_kind_val != 15 && rumor_kind_val != 7) {
|
||||
DEBUG_TRACE("[didactyl] DEBUG on_event: ignoring NIP-17 rumor kind=%d", rumor_kind_val);
|
||||
|
||||
Reference in New Issue
Block a user