Implemented loop detection for pathfinding and congestionn avoidance for announce rebroadcasts.

This commit is contained in:
Mark Qvist 2019-11-10 13:56:04 +01:00
parent 64c30488c2
commit 8e19d5bd97
2 changed files with 61 additions and 15 deletions

View file

@ -2,6 +2,7 @@ import os
import sys
import glob
import time
import random
from .Reticulum import Reticulum
from .Identity import Identity
@ -32,6 +33,8 @@ logfile = None
logdest = LOG_STDOUT
logtimefmt = "%Y-%m-%d %H:%M:%S"
random.seed(os.urandom(10))
def loglevelname(level):
if (level == LOG_CRITICAL):
return "Critical"
@ -66,6 +69,10 @@ def log(msg, level=3):
file.write(logstring+"\n")
file.close()
def rand():
result = random.random()
return result
def hexprint(data):
print(hexrep(hexrep))