mirror of
https://github.com/markqvist/Reticulum.git
synced 2024-11-22 21:50:18 +00:00
Fixed potential None reference
This commit is contained in:
parent
7ee9b07d9c
commit
254c966159
@ -530,8 +530,9 @@ class Channel(contextlib.AbstractContextManager):
|
|||||||
def _update_packet_timeouts(self):
|
def _update_packet_timeouts(self):
|
||||||
for envelope in self._tx_ring:
|
for envelope in self._tx_ring:
|
||||||
updated_timeout = self._get_packet_timeout_time(envelope.tries)
|
updated_timeout = self._get_packet_timeout_time(envelope.tries)
|
||||||
if updated_timeout > envelope.packet.receipt.timeout:
|
if envelope.packet and envelope.packet.receipt and envelope.packet.receipt.timeout:
|
||||||
envelope.packet.receipt.set_timeout(updated_timeout)
|
if updated_timeout > envelope.packet.receipt.timeout:
|
||||||
|
envelope.packet.receipt.set_timeout(updated_timeout)
|
||||||
|
|
||||||
def _get_packet_timeout_time(self, tries: int) -> float:
|
def _get_packet_timeout_time(self, tries: int) -> float:
|
||||||
to = pow(1.5, tries - 1) * max(self._outlet.rtt*2.5, 0.025) * (len(self._tx_ring)+1.5)
|
to = pow(1.5, tries - 1) * max(self._outlet.rtt*2.5, 0.025) * (len(self._tx_ring)+1.5)
|
||||||
|
Loading…
Reference in New Issue
Block a user