forked from Qortal/qortal
Delete the combined file if has an incorrect hash after joining chunks together
This commit is contained in:
parent
553de5a873
commit
623470209f
@ -355,6 +355,8 @@ public class ArbitraryDataReader {
|
|||||||
}
|
}
|
||||||
// Ensure the complete hash matches the joined chunks
|
// Ensure the complete hash matches the joined chunks
|
||||||
if (!Arrays.equals(arbitraryDataFile.digest(), digest)) {
|
if (!Arrays.equals(arbitraryDataFile.digest(), digest)) {
|
||||||
|
// Delete the invalid file
|
||||||
|
arbitraryDataFile.delete();
|
||||||
throw new DataException("Unable to validate complete file hash");
|
throw new DataException("Unable to validate complete file hash");
|
||||||
}
|
}
|
||||||
// Ensure the file's size matches the size reported by the transaction (throws a DataException if not)
|
// Ensure the file's size matches the size reported by the transaction (throws a DataException if not)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user