create remote bitfield on have message if bitfeild message was never received

This commit is contained in:
orignal committed 2026-08-30 12:43:49 -04:00
1 parent 0c576aa8eb
commit 0b941d8f10
1 file changed
+2
+2
View File
@@ -1201,6 +1201,8 @@ namespace torrents
void PeerConnection::HandleHaveMsg (const uint8_t * buf, size_t len)
{
if (len < 4) return;
if (m_RemoteBitfield.empty ()) // bitfield was not received before because was empty
m_RemoteBitfield.resize (m_Torrent->GetNumPieces ());
uint32_t index = bufbe32toh (buf);
if (index < m_RemoteBitfield.size ())
{