mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-06-01 21:22:10 -04:00
verify offer versions when signing
This commit is contained in:
parent
bee86daff3
commit
b5f9bc307b
5 changed files with 55 additions and 7 deletions
|
@ -72,6 +72,25 @@ public class Version {
|
|||
return false;
|
||||
}
|
||||
|
||||
public static int compare(String version1, String version2) {
|
||||
if (version1.equals(version2))
|
||||
return 0;
|
||||
else if (getMajorVersion(version1) > getMajorVersion(version2))
|
||||
return 1;
|
||||
else if (getMajorVersion(version1) < getMajorVersion(version2))
|
||||
return -1;
|
||||
else if (getMinorVersion(version1) > getMinorVersion(version2))
|
||||
return 1;
|
||||
else if (getMinorVersion(version1) < getMinorVersion(version2))
|
||||
return -1;
|
||||
else if (getPatchVersion(version1) > getPatchVersion(version2))
|
||||
return 1;
|
||||
else if (getPatchVersion(version1) < getPatchVersion(version2))
|
||||
return -1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static int getSubVersion(String version, int index) {
|
||||
final String[] split = version.split("\\.");
|
||||
checkArgument(split.length == 3, "Version number must be in semantic version format (contain 2 '.'). version=" + version);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue