diff --git a/libtransmission/torrent-magnet.c b/libtransmission/torrent-magnet.c index e063071fc..cf91d0e01 100644 --- a/libtransmission/torrent-magnet.c +++ b/libtransmission/torrent-magnet.c @@ -299,6 +299,9 @@ tr_torrentSetMetadataPiece (tr_torrent * tor, int piece, const void * data, in { incompleteMetadataFree (tor->incompleteMetadata); tor->incompleteMetadata = NULL; + tor->isStopping = true; + tor->magnetVerify = true; + tor->startAfterVerify = true; } else /* drat. */ { diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index f02ada4e5..224721a3e 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -1873,6 +1873,14 @@ stopTorrent (void * vtor) torrentSetQueued (tor, false); tr_torrentUnlock (tor); + + if (tor->magnetVerify) + { + tor->magnetVerify = false; + tr_logAddTorInfo (tor, "%s", "Magnet Verify"); + refreshCurrentDir (tor); + tr_torrentVerify (tor, NULL, NULL); + } } void @@ -1907,6 +1915,7 @@ closeTorrent (void * vtor) tr_logAddTorInfo (tor, "%s", _("Removing torrent")); + tor->magnetVerify = false; stopTorrent (tor); if (tor->isDeleting) diff --git a/libtransmission/torrent.h b/libtransmission/torrent.h index dcaa327d3..6028d273d 100644 --- a/libtransmission/torrent.h +++ b/libtransmission/torrent.h @@ -247,6 +247,8 @@ struct tr_torrent bool isDirty; bool isQueued; + bool magnetVerify; + bool infoDictOffsetIsCached; uint16_t maxConnectedPeers;