From 942f2cb3d180176e2cd1828aecc11996d1b24efb Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 8 Jan 2026 00:32:09 -0600 Subject: [PATCH] Tryfix next --- src/modules/Native/StoreForwardPlusPlus.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/modules/Native/StoreForwardPlusPlus.cpp b/src/modules/Native/StoreForwardPlusPlus.cpp index 30aa54172..a186004d0 100644 --- a/src/modules/Native/StoreForwardPlusPlus.cpp +++ b/src/modules/Native/StoreForwardPlusPlus.cpp @@ -774,8 +774,16 @@ bool StoreForwardPlusPlusModule::handleReceivedProtobuf(const meshtastic_MeshPac } } } else { - // We've received a link provide, and it doesn't fit. But it may be legit. Add it to canon_scratch - addToCanonScratch(incoming_link); + LOG_INFO("StoreForwardpp Recalculated hash does not match."); + if (incoming_link.commit_hash_len == 0) { + addToScratch(incoming_link); + } else if (incoming_link.commit_hash_len == SFPP_HASH_SIZE && chain_end.counter == 0) { + addToChain(incoming_link); + } else { + + // We've received a link provide, and it doesn't fit. But it may be legit. Add it to canon_scratch + addToCanonScratch(incoming_link); + } } } @@ -1843,7 +1851,12 @@ void StoreForwardPlusPlusModule::addToCanonScratch(link_object &lo) { // recalculate full message hash? - LOG_INFO("addToCanonScratch"); + LOG_INFO("StoreForwardpp addToCanonScratch"); + if (lo.counter == 0) { + LOG_WARN("StoreForwardpp Counter 0, not adding to Canon Scratch"); + return; + } + logLinkObject(lo); // push a message into the local chain DB