i2psnark: Fix bad completion status after recheck (ticket #2046)

Only occurred if torrent had previously run, was previously incomplete,
and was now complete.
Also fixed changed-after-recheck logic to be precise.
This commit is contained in:
zzz
2017-11-16 02:26:29 +00:00
parent e78081f33b
commit e9ff0c2882
4 changed files with 36 additions and 10 deletions

View File

@@ -170,7 +170,24 @@ public class BitField
return count >= size;
}
@Override
/** @since 0.9.33 */
@Override
public int hashCode() {
return (count << 16) ^ size;
}
/** @since 0.9.33 */
@Override
public boolean equals(Object o) {
if (o == null || !(o instanceof BitField))
return false;
BitField bf = (BitField) o;
return count == bf.count() &&
size == bf.size() &&
Arrays.equals(bitfield, bf.getFieldBytes());
}
@Override
public String toString()
{
// Not very efficient