mirror of
https://github.com/markqvist/Reticulum.git
synced 2024-11-26 07:20:18 +00:00
Check ratchet dir exists before cleaning
This commit is contained in:
parent
6a392fdb0f
commit
971f5ffadd
@ -249,7 +249,7 @@ class Identity:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _remember_ratchet(destination_hash, ratchet):
|
def _remember_ratchet(destination_hash, ratchet):
|
||||||
# TODO: Remove at some point
|
# TODO: Remove at some point, and only log new ratchets
|
||||||
RNS.log(f"Remembering ratchet {RNS.prettyhexrep(Identity.truncated_hash(ratchet))} for {RNS.prettyhexrep(destination_hash)}", RNS.LOG_EXTREME)
|
RNS.log(f"Remembering ratchet {RNS.prettyhexrep(Identity.truncated_hash(ratchet))} for {RNS.prettyhexrep(destination_hash)}", RNS.LOG_EXTREME)
|
||||||
try:
|
try:
|
||||||
Identity.known_ratchets[destination_hash] = ratchet
|
Identity.known_ratchets[destination_hash] = ratchet
|
||||||
@ -286,6 +286,7 @@ class Identity:
|
|||||||
try:
|
try:
|
||||||
now = time.time()
|
now = time.time()
|
||||||
ratchetdir = RNS.Reticulum.storagepath+"/ratchets"
|
ratchetdir = RNS.Reticulum.storagepath+"/ratchets"
|
||||||
|
if os.path.isdir(ratchetdir):
|
||||||
for filename in os.listdir(ratchetdir):
|
for filename in os.listdir(ratchetdir):
|
||||||
try:
|
try:
|
||||||
expired = False
|
expired = False
|
||||||
|
Loading…
Reference in New Issue
Block a user