/* */ #include "HaveEraseCommand.h" HaveEraseCommand::HaveEraseCommand(int32_t cuid, TorrentDownloadEngine* e, const BtContextHandle& btContext, int32_t interval) :BtContextAwareCommand(cuid, btContext), e(e), interval(interval) {} bool HaveEraseCommand::execute() { if(btRuntime->isHalt()) { return true; } if(cp.elapsed(interval)) { cp.reset(); pieceStorage->removeAdvertisedPiece(5); } e->commands.push_back(this); return false; }