From 248bb9c61e1a5a0d7f22b91e20ff1a285a01ef2b Mon Sep 17 00:00:00 2001 From: Thulinma Date: Fri, 22 Jan 2021 23:01:55 +0100 Subject: [PATCH] Sanitycheck extra sanity checks --- src/output/output_sanitycheck.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/output/output_sanitycheck.cpp b/src/output/output_sanitycheck.cpp index fb79d98c..bf64bc3b 100644 --- a/src/output/output_sanitycheck.cpp +++ b/src/output/output_sanitycheck.cpp @@ -135,6 +135,15 @@ namespace Mist{ return; } + + size_t keyIndex = M.getKeyIndexForTime(getMainSelectedTrack(), thisPacket.getTime()); + uint64_t keyTime = M.getTimeForKeyIndex(getMainSelectedTrack(), keyIndex); + if (keyTime > thisPacket.getTime()){ + std::cout << "Corruption? Our time is " << thisPacket.getTime() << ", but our key time is " << keyTime << std::endl; + myConn.close(); + return; + } + // Packet is normally sent here packets.push_back(thisPacket.toSummary()); while (packets.size() > 10){packets.pop_front();}