mirror of
https://github.com/markqvist/LXMF
synced 2026-11-22 23:10:36 +00:00
Set delivery and propagation link costs
This commit is contained in:
1 file changed
+5
@@ -50,6 +50,9 @@ class LXMRouter:
|
||||
|
||||
NODE_ANNOUNCE_DELAY = 20
|
||||
|
||||
DELIVERY_LINK_COST = 3.25
|
||||
PROPAGATION_LINK_COST = 3.25
|
||||
|
||||
MAX_PEERS = 20
|
||||
AUTOPEER = True
|
||||
AUTOPEER_MAXDEPTH = 4
|
||||
@@ -416,6 +419,7 @@ class LXMRouter:
|
||||
os.makedirs(self.ratchetpath)
|
||||
|
||||
delivery_destination = RNS.Destination(identity, RNS.Destination.IN, RNS.Destination.SINGLE, APP_NAME, "delivery")
|
||||
delivery_destination.set_link_cost(self.DELIVERY_LINK_COST)
|
||||
delivery_destination.enable_ratchets(f"{self.ratchetpath}/{RNS.hexrep(delivery_destination.hash, delimit=False)}.ratchets")
|
||||
delivery_destination.set_packet_callback(self.delivery_packet)
|
||||
delivery_destination.set_link_established_callback(self.delivery_link_established)
|
||||
@@ -627,6 +631,7 @@ class LXMRouter:
|
||||
try:
|
||||
if not self.propagation_destination:
|
||||
self.propagation_destination = RNS.Destination(self.identity, RNS.Destination.IN, RNS.Destination.SINGLE, APP_NAME, "propagation")
|
||||
self.propagation_destination.set_link_cost(self.PROPAGATION_LINK_COST)
|
||||
self.propagation_destination.set_default_app_data(self.get_propagation_node_app_data)
|
||||
|
||||
self.messagepath = self.storagepath+"/messagestore"
|
||||
|
||||
Reference in new issue
Block a user