Revert "Only send Neighbours if we have some to send. (#7493)"

This reverts commit b0e8321514.
This commit is contained in:
Tom Fifield
2025-11-08 14:08:44 +11:00
committed by GitHub
parent b707001873
commit e6445b2523

View File

@@ -105,15 +105,14 @@ void NeighborInfoModule::sendNeighborInfo(NodeNum dest, bool wantReplies)
{ {
meshtastic_NeighborInfo neighborInfo = meshtastic_NeighborInfo_init_zero; meshtastic_NeighborInfo neighborInfo = meshtastic_NeighborInfo_init_zero;
collectNeighborInfo(&neighborInfo); collectNeighborInfo(&neighborInfo);
// only send neighbours if we have some to send meshtastic_MeshPacket *p = allocDataProtobuf(neighborInfo);
if (neighborInfo.neighbors_count > 0) { // send regardless of whether or not we have neighbors in our DB,
meshtastic_MeshPacket *p = allocDataProtobuf(neighborInfo); // because we want to get neighbors for the next cycle
p->to = dest; p->to = dest;
p->decoded.want_response = wantReplies; p->decoded.want_response = wantReplies;
p->priority = meshtastic_MeshPacket_Priority_BACKGROUND; p->priority = meshtastic_MeshPacket_Priority_BACKGROUND;
printNeighborInfo("SENDING", &neighborInfo); printNeighborInfo("SENDING", &neighborInfo);
service->sendToMesh(p, RX_SRC_LOCAL, true); service->sendToMesh(p, RX_SRC_LOCAL, true);
}
} }
/* /*
@@ -215,4 +214,4 @@ meshtastic_Neighbor *NeighborInfoModule::getOrCreateNeighbor(NodeNum originalSen
neighbors.push_back(new_nbr); neighbors.push_back(new_nbr);
} }
return &neighbors.back(); return &neighbors.back();
} }