mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-09-30 13:03:05 +02:00
catch exception for malformed relays in users relay inbox
This commit is contained in:
@@ -140,7 +140,10 @@ def send_event_outbox(event: Event, client, dvm_config) -> EventId:
|
||||
for index, param in enumerate(tag.as_vec()):
|
||||
if index != 0:
|
||||
if tag.as_vec()[index].rstrip("/") not in dvm_config.AVOID_PAID_OUTBOX_RELAY_LIST:
|
||||
try:
|
||||
relays.append(tag.as_vec()[index])
|
||||
except:
|
||||
print(tag.as_vec()[index] + "couldn't be added")
|
||||
break
|
||||
|
||||
|
||||
@@ -168,10 +171,18 @@ def send_event_outbox(event: Event, client, dvm_config) -> EventId:
|
||||
|
||||
for relay in relays:
|
||||
opts = RelayOptions().ping(False)
|
||||
try:
|
||||
outboxclient.add_relay_with_opts(relay, opts)
|
||||
except:
|
||||
print(relay + "couldn't be added")
|
||||
|
||||
|
||||
outboxclient.connect()
|
||||
try:
|
||||
event_id = outboxclient.send_event(event)
|
||||
except:
|
||||
event_id = send_event(event, client, dvm_config)
|
||||
|
||||
outboxclient.shutdown()
|
||||
|
||||
return event_id
|
||||
|
Reference in New Issue
Block a user