From 2f3320270d7557d6bd0eccd6c1ab733c303a4562 Mon Sep 17 00:00:00 2001 From: medentem Date: Fri, 10 Jan 2025 11:39:09 -0600 Subject: [PATCH] this might work... still need to be tested --- src/mesh/FloodingRouter.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mesh/FloodingRouter.cpp b/src/mesh/FloodingRouter.cpp index 878b5ae0c..c4dafeb88 100644 --- a/src/mesh/FloodingRouter.cpp +++ b/src/mesh/FloodingRouter.cpp @@ -169,6 +169,7 @@ float FloodingRouter::calculateForwardProbability(const CoverageFilter &incoming return 1.0f; #endif // If we are a router or repeater, always forward because it's assumed these are in the most advantageous locations + // Small meshes don't use coverage filter if (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER || config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER) { return 1.0f; @@ -214,7 +215,11 @@ float FloodingRouter::calculateForwardProbability(const CoverageFilter &incoming coverageRatio = uncoveredWeight / totalWeight; } - float forwardProb = (coverageRatio * COVERAGE_SCALE_FACTOR); + float smallMeshCorrection = 0.0f; + if (nodeDB->getNumOnlineMeshNodes(true) <= 10) { + smallMeshCorrection = 0.5f; + } + float forwardProb = (coverageRatio * COVERAGE_SCALE_FACTOR) + smallMeshCorrection; // Clamp probability between BASE_FORWARD_PROB and 1 forwardProb = std::min(std::max(forwardProb, BASE_FORWARD_PROB), 1.0f);