forked from Qortal/qortal
Delete chunk if it fails the hash validation in the constructor.
This commit is contained in:
parent
f82f2bd287
commit
1e8dbfe4b7
@ -37,6 +37,7 @@ public class DataFileChunk extends DataFile {
|
|||||||
// Verify hash
|
// Verify hash
|
||||||
if (!base58Digest.equals(this.base58Digest())) {
|
if (!base58Digest.equals(this.base58Digest())) {
|
||||||
LOGGER.error("Digest {} does not match file digest {}", base58Digest, this.base58Digest());
|
LOGGER.error("Digest {} does not match file digest {}", base58Digest, this.base58Digest());
|
||||||
|
this.delete();
|
||||||
throw new IllegalStateException("DataFileChunk digest validation failed");
|
throw new IllegalStateException("DataFileChunk digest validation failed");
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user