tr_cryptoConstruct (&a, NULL, true);
check (!tr_cryptoHasTorrentHash (&a));
-#ifdef NDEBUG
check (tr_cryptoGetTorrentHash (&a) == NULL);
-#endif
tr_cryptoSetTorrentHash (&a, hash);
check (tr_cryptoHasTorrentHash (&a));
tr_cryptoSetTorrentHash (&a, NULL);
check (!tr_cryptoHasTorrentHash (&a));
-#ifdef NDEBUG
check (tr_cryptoGetTorrentHash (&a) == NULL);
-#endif
tr_cryptoDestruct (&a);
tr_cryptoGetTorrentHash (const tr_crypto * crypto)
{
assert (crypto);
- assert (crypto->torrentHashIsSet);
- return crypto->torrentHash;
+ return crypto->torrentHashIsSet ? crypto->torrentHash : NULL;
}
int