Working chain trimming

This commit is contained in:
Jonathan Bennett
2025-12-29 18:50:34 -06:00
parent 25383c9523
commit f8c27d1714
2 changed files with 49 additions and 6 deletions

View File

@@ -117,6 +117,8 @@ class StoreForwardPlusPlusModule : public ProtobufModule<meshtastic_StoreForward
sqlite3_stmt *getFullRootHashStmt;
sqlite3_stmt *setChainCountStmt;
sqlite3_stmt *getChainCountStmt;
sqlite3_stmt *pruneScratchQueueStmt;
sqlite3_stmt *trimOldestLinkStmt;
// For a given Meshtastic ChannelHash, fills the root_hash buffer with a 32-byte root hash
// returns true if the root hash was found
@@ -210,6 +212,10 @@ class StoreForwardPlusPlusModule : public ProtobufModule<meshtastic_StoreForward
link_object getLinkFromCount(uint32_t, uint8_t *, size_t);
void pruneScratchQueue();
void trimOldestLink(uint8_t *, size_t);
// Track if we have a scheduled runOnce pending
// useful to not accudentally delay a scheduled runOnce
bool pendingRun = false;