From a18488502303b5a28039a12d84cb2a45a01fb437 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Mon, 15 Dec 2025 11:01:03 -0600 Subject: [PATCH] logic fix --- src/modules/Native/StoreForwardPlusPlus.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/Native/StoreForwardPlusPlus.cpp b/src/modules/Native/StoreForwardPlusPlus.cpp index 19e6e8315..6b10a0c3a 100644 --- a/src/modules/Native/StoreForwardPlusPlus.cpp +++ b/src/modules/Native/StoreForwardPlusPlus.cpp @@ -141,11 +141,11 @@ StoreForwardPlusPlusModule::StoreForwardPlusPlusModule() encrypted_bytes, message_hash, rx_time, payload) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?);", -1, &scratch_insert_stmt, NULL); - sqlite3_prepare_v2(ppDb, "SELECT COUNT(*) from channel_messages where commit_hash=?", -1, &checkDup, NULL); + sqlite3_prepare_v2(ppDb, "SELECT COUNT(*) from channel_messages where message_hash=?", -1, &checkDup, NULL); - sqlite3_prepare_v2(ppDb, "SELECT COUNT(*) from local_messages where commit_hash=?", -1, &checkScratch, NULL); + sqlite3_prepare_v2(ppDb, "SELECT COUNT(*) from local_messages where message_hash=?", -1, &checkScratch, NULL); - sqlite3_prepare_v2(ppDb, "DELETE from local_messages where commit_hash=?", -1, &removeScratch, NULL); + sqlite3_prepare_v2(ppDb, "DELETE from local_messages where message_hash=?", -1, &removeScratch, NULL); encryptedOk = true; @@ -734,6 +734,7 @@ bool StoreForwardPlusPlusModule::isInDB(uint8_t *message_hash_bytes) bool StoreForwardPlusPlusModule::isInScratch(uint8_t *message_hash_bytes) { + LOG_WARN("isInScratch"); sqlite3_bind_blob(checkScratch, 1, message_hash_bytes, 32, NULL); sqlite3_step(checkScratch); int numberFound = sqlite3_column_int(checkScratch, 0);