Skip to content

Commit 48c869d

Browse files
committed
fix a bug in logging
1 parent c54800c commit 48c869d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/logging/logging.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,12 +576,14 @@ class qLogger
576576
#endif
577577
}
578578

579+
// updateTick is called right after _tick is processed
579580
static void updateTick(unsigned int _tick)
580581
{
581582
#if ENABLED_LOGGING
582583
ASSERT((_tick == lastUpdatedTick + 1) || (_tick == tickBegin));
584+
ASSERT(_tick >= tickBegin);
583585
#if LOG_STATE_DIGEST
584-
unsigned long long index = lastUpdatedTick - tickBegin;
586+
unsigned long long index = _tick - tickBegin;
585587
XKCP::KangarooTwelve_Final(&k12, digests[index].m256i_u8, (const unsigned char*)"", 0);
586588
XKCP::KangarooTwelve_Initialize(&k12, 128, 32); // init new k12
587589
XKCP::KangarooTwelve_Update(&k12, digests[index].m256i_u8, 32); // feed the prev hash back to this

0 commit comments

Comments
 (0)