mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-12 03:27:06 +10:00
fix from copilot review + doc fix
This commit is contained in:
@@ -38,6 +38,7 @@ class PathHelper {
|
||||
/// - 1: Single byte per hop (256 unique nodes)
|
||||
/// - 2: Two bytes per hop (65K unique nodes)
|
||||
/// - 3: Three bytes per hop (16M unique nodes)
|
||||
/// - 4: Four bytes per hop (4.3G unique nodes)
|
||||
static String resolvePathNames(
|
||||
List<int> pathBytes,
|
||||
List<Contact> allContacts,
|
||||
|
||||
@@ -47,14 +47,12 @@ class ChannelMessagePathScreen extends StatelessWidget {
|
||||
final hops = _buildPathHops(primaryPath, connector, l10n, hashByteWidth);
|
||||
final hasHopDetails = primaryPath.isNotEmpty;
|
||||
|
||||
// Convert path byte length to hop count using the packet width.
|
||||
// Convert observed path byte length to hop count using the packet width.
|
||||
// Legacy messages fall back to the current connector width.
|
||||
// Reported path length (V3+) is already stored as a hop count; preserve
|
||||
// the negative flood sentinel when present.
|
||||
final observedHopCount = _hopCountFromBytes(primaryPath.length, hashByteWidth);
|
||||
final reportedHopCount = message.pathLength == null
|
||||
? null
|
||||
: (message.pathLength! < 0
|
||||
? message.pathLength
|
||||
: _hopCountFromBytes(message.pathLength!, hashByteWidth));
|
||||
final reportedHopCount = message.pathLength;
|
||||
final effectiveHopCount = observedHopCount > 0
|
||||
? observedHopCount
|
||||
: reportedHopCount;
|
||||
|
||||
Reference in New Issue
Block a user