fix rare assert

This commit is contained in:
Green Sky 2024-08-08 23:52:36 +02:00
parent a761378dd9
commit 1d7416efed
No known key found for this signature in database

View File

@ -1102,8 +1102,11 @@ bool SHA1_NGCFT1::onEvent(const Events::NGCFT1_recv_done& e) {
// something happend, update chunk picker
auto c = _tcm.getContactGroupPeer(e.group_number, e.peer_number);
assert(static_cast<bool>(c));
c.emplace_or_replace<ChunkPickerUpdateTag>();
//assert(static_cast<bool>(c));
// happened, went offline but chunk was still done o.o
if (static_cast<bool>(c)) {
c.emplace_or_replace<ChunkPickerUpdateTag>();
}
} else {
// bad chunk
std::cout << "SHA1_NGCFT1: got BAD chunk from " << e.group_number << ":" << e.peer_number << " [" << info.chunks.at(chunk_index) << "] ; instead got [" << SHA1Digest{got_hash} << "]\n";