Add peers table, check for null

This commit is contained in:
Jonathan Bennett
2026-01-01 13:47:50 -06:00
parent 1fecdc7603
commit baccd0c532
2 changed files with 109 additions and 70 deletions

View File

@@ -119,6 +119,7 @@ class StoreForwardPlusPlusModule : public ProtobufModule<meshtastic_StoreForward
sqlite3_stmt *getChainCountStmt;
sqlite3_stmt *pruneScratchQueueStmt;
sqlite3_stmt *trimOldestLinkStmt;
sqlite3_stmt *maybeAddPeerStmt;
// For a given Meshtastic ChannelHash, fills the root_hash buffer with a 32-byte root hash
// returns true if the root hash was found
@@ -216,6 +217,12 @@ class StoreForwardPlusPlusModule : public ProtobufModule<meshtastic_StoreForward
void trimOldestLink(uint8_t *, size_t);
// given a link object with a payload and other fields, recalculates the message hash
// returns true if a match
bool recalculateHash(link_object &, uint8_t *, size_t, uint8_t *, size_t);
void maybeAddPeer(const meshtastic_MeshPacket &);
// Track if we have a scheduled runOnce pending
// useful to not accudentally delay a scheduled runOnce
bool pendingRun = false;