i2psnark edit torrent does not work sometimes
Steps to reproduce:
- Go to tracker2.postman.i2p and gather few random info hashes, or magnet links.
- Open i2psnark web interface.
- Add new torrents to be downloaded by specifying the gathered info hashes.
- Wait for the i2psnark to download more information. Equivalent of using .torrent file instead of info hash.
- Open torrent details, stop torrent if it is running, go to trackers section, add tracker, save.
Expected behavior:
- Trackers are added or removed from torrent, according the action taken in the web interface.
Actual behavior:
- Torrent edit failed, infohash mismatch
- Torrent edit of xxx failed: Infohash mismatch
This does not affect all torrents, only some of them, for example 589ac5e4f3434f7f6170eb3b93090a4bf3070729
. The reason is that after editing a torrent, there is infohash re-computation triggered. This re-computation is done wrong. Editing list of trackers does not invalidate infohash. But the re-computation is triggered regardless. It does not take all the information the original .torrent creator used in order to compute the infohash.
In order to fix this issue, I suggest to just update the list of trackers (and comment and created by) and do not touch any other torrent properties. Thus keeping the infohash as it was before tracker list edit, skipping any and all incorrect infohash computation.