Do nothing if block has already acquired.

This happens in end-game mode.
pull/1/head
Tatsuhiro Tsujikawa 2011-07-16 00:23:45 +09:00
parent ee1223210d
commit 44c379eaa8
1 changed files with 4 additions and 0 deletions

View File

@ -115,6 +115,10 @@ void BtPieceMessage::doReceivedAction()
blockLength_,
static_cast<long long int>(offset),
static_cast<unsigned long>(slot.getBlockIndex())));
if(piece->hasBlock(slot.getBlockIndex())) {
A2_LOG_DEBUG("Already have this block.");
return;
}
getPieceStorage()->getDiskAdaptor()->writeData
(block_, blockLength_, offset);
piece->completeBlock(slot.getBlockIndex());