We could improve the java code by implementing additional validation. E.g. prev tx hash is expected to be a specific length.