v0.4.7 - Implement NIP-70 Protected Events - Add protected event support with authentication checks, comprehensive testing, and relay metadata protection
This commit is contained in:
@@ -160,6 +160,8 @@ int update_cache_value(const char* key, const char* value) {
|
||||
g_unified_cache.nip42_challenge_timeout = atoi(value);
|
||||
} else if (strcmp(key, "nip42_time_tolerance") == 0) {
|
||||
g_unified_cache.nip42_time_tolerance = atoi(value);
|
||||
} else if (strcmp(key, "nip70_protected_events_enabled") == 0) {
|
||||
g_unified_cache.nip70_protected_events_enabled = (strcmp(value, "true") == 0) ? 1 : 0;
|
||||
} else {
|
||||
// For NIP-11 relay info fields, update the cache buffers
|
||||
if (strcmp(key, "relay_name") == 0) {
|
||||
@@ -259,6 +261,10 @@ static int refresh_unified_cache_from_table(void) {
|
||||
const char* time_tolerance = get_config_value_from_table("nip42_time_tolerance");
|
||||
g_unified_cache.nip42_time_tolerance = time_tolerance ? atoi(time_tolerance) : 300;
|
||||
|
||||
// Load NIP-70 protected events config
|
||||
const char* nip70_enabled = get_config_value_from_table("nip70_protected_events_enabled");
|
||||
g_unified_cache.nip70_protected_events_enabled = (nip70_enabled && strcmp(nip70_enabled, "true") == 0) ? 1 : 0;
|
||||
|
||||
// Set cache expiration
|
||||
int cache_timeout = get_cache_timeout();
|
||||
g_unified_cache.cache_expires = time(NULL) + cache_timeout;
|
||||
|
||||
Reference in New Issue
Block a user