fixup! refactor: tr_peerMsgs.percentDone() (#3363) (#3365)

This commit is contained in:
Charles Kerr 2022-06-27 18:16:08 -05:00 committed by GitHub
parent b893289392
commit 5841441dd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1757,7 +1757,7 @@ static ReadState readBtMessage(tr_peerMsgsImpl* msgs, struct evbuffer* inbuf, si
logtrace(msgs, "got a bitfield");
auto tmp = std::vector<uint8_t>(msglen);
tr_peerIoReadBytes(msgs->io, inbuf, std::data(tmp), std::size(tmp));
msgs->have_ = tr_bitfield{ msgs->torrent->hasMetainfo() ? msgs->torrent->pieceCount() : std::size(tmp) };
msgs->have_ = tr_bitfield{ msgs->torrent->hasMetainfo() ? msgs->torrent->pieceCount() : std::size(tmp) * 8 };
msgs->have_.setRaw(std::data(tmp), std::size(tmp));
msgs->publishClientGotBitfield(&msgs->have_);
msgs->invalidatePercentDone();