Mark messages as processed

This commit is contained in:
Andrea Maria Piana 2022-01-13 10:06:01 +00:00
parent 9d8ec4432e
commit f5b8774f51
1 changed files with 6 additions and 1 deletions

View File

@ -3435,8 +3435,13 @@ func (m *Messenger) handleRetrievedMessages(chatWithMessages map[transport.Filte
// Clean up as not used by clients currently
messageState.Response.CommunityChanges = nil
// NOTE: for now we confirm messages as processed regardless whether we
// actually processed them, this is because we need to differentiate
// from messages that we want to retry to process and messages that
// are never going to be processed
m.transport.MarkP2PMessageAsProcessed(gethcommon.BytesToHash(shhMessage.Hash))
if allMessagesProcessed {
m.transport.MarkP2PMessageAsProcessed(gethcommon.BytesToHash(shhMessage.Hash))
processedMessages = append(processedMessages, types.EncodeHex(shhMessage.Hash))
}
}