Fix #51: These last days the algorithm seems to not treat completely firstly the starting set of channels before treating discovered channels

I verified that this commit solves the issue by treating only `CHANNELS` tab of the channels in `channels.txt`.
This commit is contained in:
Benjamin Loison 2023-02-22 04:09:35 +01:00
parent 76e41f2f7b
commit 7626c7bad1
Signed by: Benjamin_Loison
SSH Key Fingerprint: SHA256:BtnEgYTlHdOg1u+RmYcDE0mnfz1rhv5dSbQ2gyxW8B8

View File

@ -631,7 +631,8 @@ void addChannelToTreat(unsigned short threadId, string channelId)
channelsAlreadyTreatedAndToTreatMutex.lock();
if(channelsAlreadyTreated.find(channelId) == channelsAlreadyTreated.end() && channelsToTreatRev.find(channelId) == channelsToTreatRev.end())
{
unsigned int channelsToTreatIndex = channelsToTreat.end()->first + 1;
// It is unclear to me why `channelsToTreat.end()->first + 1` doesn't work here.
unsigned int channelsToTreatIndex = channelsToTreat.rbegin()->first + 1;
channelsToTreat[channelsToTreatIndex] = channelId;
channelsToTreatRev[channelId] = channelsToTreatIndex;