mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-10-08 22:52:29 +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()):
|
for index, param in enumerate(tag.as_vec()):
|
||||||
if index != 0:
|
if index != 0:
|
||||||
if tag.as_vec()[index].rstrip("/") not in dvm_config.AVOID_PAID_OUTBOX_RELAY_LIST:
|
if tag.as_vec()[index].rstrip("/") not in dvm_config.AVOID_PAID_OUTBOX_RELAY_LIST:
|
||||||
|
try:
|
||||||
relays.append(tag.as_vec()[index])
|
relays.append(tag.as_vec()[index])
|
||||||
|
except:
|
||||||
|
print(tag.as_vec()[index] + "couldn't be added")
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
@@ -168,10 +171,18 @@ def send_event_outbox(event: Event, client, dvm_config) -> EventId:
|
|||||||
|
|
||||||
for relay in relays:
|
for relay in relays:
|
||||||
opts = RelayOptions().ping(False)
|
opts = RelayOptions().ping(False)
|
||||||
|
try:
|
||||||
outboxclient.add_relay_with_opts(relay, opts)
|
outboxclient.add_relay_with_opts(relay, opts)
|
||||||
|
except:
|
||||||
|
print(relay + "couldn't be added")
|
||||||
|
|
||||||
|
|
||||||
outboxclient.connect()
|
outboxclient.connect()
|
||||||
|
try:
|
||||||
event_id = outboxclient.send_event(event)
|
event_id = outboxclient.send_event(event)
|
||||||
|
except:
|
||||||
|
event_id = send_event(event, client, dvm_config)
|
||||||
|
|
||||||
outboxclient.shutdown()
|
outboxclient.shutdown()
|
||||||
|
|
||||||
return event_id
|
return event_id
|
||||||
|
Reference in New Issue
Block a user