Skip to content

Commit

Permalink
Adjusted timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
markqvist committed Nov 2, 2023
1 parent 082026c commit 82bb479
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion nomadnet/Conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def __init__(self, source_hash, app, initiator=False):

self.__changed_callback = None

if not RNS.Transport.has_path(bytes.fromhex(source_hash)):
if not RNS.Identity.recall(bytes.fromhex(self.source_hash)):
RNS.Transport.request_path(bytes.fromhex(source_hash))

self.source_identity = RNS.Identity.recall(bytes.fromhex(self.source_hash))
Expand Down
4 changes: 2 additions & 2 deletions nomadnet/ui/textui/Browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ def download_file(self, destination_hash, path):
self.status = Browser.PATH_REQUESTED
self.update_display()

pr_time = time.time()
pr_time = time.time()+RNS.Transport.first_hop_timeout(self.destination_hash)
while not RNS.Transport.has_path(self.destination_hash):
now = time.time()
if now > pr_time+self.timeout:
Expand Down Expand Up @@ -770,7 +770,7 @@ def __load(self):
self.status = Browser.PATH_REQUESTED
self.update_display()

pr_time = time.time()
pr_time = time.time()+RNS.Transport.first_hop_timeout(self.destination_hash)
while not RNS.Transport.has_path(self.destination_hash):
now = time.time()
if now > pr_time+self.timeout:
Expand Down
2 changes: 1 addition & 1 deletion nomadnet/ui/textui/Conversations.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ def check_editor_allowed(self):
if allowed:
self.frame.contents["footer"] = (self.minimal_editor, None)
else:
warning = urwid.AttrMap(urwid.Padding(urwid.Text("\n"+g["info"]+"\n\nYou cannot currently message this peer, since it's identity keys are not known.\n\nWait for an announce to arrive from the peer, or query the network for it.\n\nTo query the network, select this conversation in the conversation list, press Ctrl-E, and use the query button.\n", align="center")), "msg_header_caution")
warning = urwid.AttrMap(urwid.Padding(urwid.Text("\n"+g["info"]+"\n\nYou cannot currently message this peer, since it's identity keys are not known. The keys have been requested from the network and should arrive shortly, if available. Close this conversation and reopen it to try again.\n\nWait for this announce to arrive from, or query the network manually.\n\nTo query the network, select this conversation in the conversation list, press Ctrl-E, and use the query button.\n", align="center")), "msg_header_caution")
self.frame.contents["footer"] = (warning, None)

def toggle_focus_area(self):
Expand Down

0 comments on commit 82bb479

Please sign in to comment.