Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/MeshCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <stdint.h>
#include <math.h>

#define MAX_HASH_SIZE 8
#define MAX_HASH_SIZE 4
#define PUB_KEY_SIZE 32
#define PRV_KEY_SIZE 64
#define SEED_SIZE 32
Expand Down
10 changes: 5 additions & 5 deletions src/helpers/SimpleMeshTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class SimpleMeshTables : public mesh::MeshTables {
uint8_t _hashes[MAX_PACKET_HASHES*MAX_HASH_SIZE];
int _next_idx;
uint32_t _acks[MAX_PACKET_ACKS];
uint8_t _acks[MAX_PACKET_ACKS*MAX_HASH_SIZE];
int _next_ack_idx;
uint32_t _direct_dups, _flood_dups;

Expand Down Expand Up @@ -42,8 +42,8 @@ class SimpleMeshTables : public mesh::MeshTables {

bool hasSeen(const mesh::Packet* packet) override {
if (packet->getPayloadType() == PAYLOAD_TYPE_ACK) {
uint32_t ack;
memcpy(&ack, packet->payload, 4);
uint8_t ack;
memcpy(&ack, packet->payload, MAX_HASH_SIZE);
for (int i = 0; i < MAX_PACKET_ACKS; i++) {
if (ack == _acks[i]) {
if (packet->isRouteDirect()) {
Expand Down Expand Up @@ -82,8 +82,8 @@ class SimpleMeshTables : public mesh::MeshTables {

void clear(const mesh::Packet* packet) override {
if (packet->getPayloadType() == PAYLOAD_TYPE_ACK) {
uint32_t ack;
memcpy(&ack, packet->payload, 4);
uint8_t ack;
memcpy(&ack, packet->payload, MAX_HASH_SIZE);
for (int i = 0; i < MAX_PACKET_ACKS; i++) {
if (ack == _acks[i]) {
_acks[i] = 0;
Expand Down