Added defensiveness in getOnlineTimestampModulus(), just in case NTP.getTime() returns null

This commit is contained in:
CalDescent 2022-06-02 12:46:11 +01:00
parent 0c3988202e
commit ef51cf5702

View File

@ -117,7 +117,8 @@ public class OnlineAccountsManager extends Thread {
} }
public static long getOnlineTimestampModulus() { public static long getOnlineTimestampModulus() {
if (NTP.getTime() >= BlockChain.getInstance().getOnlineAccountsModulusV2Timestamp()) { Long now = NTP.getTime();
if (now != null && now >= BlockChain.getInstance().getOnlineAccountsModulusV2Timestamp()) {
return ONLINE_TIMESTAMP_MODULUS_V2; return ONLINE_TIMESTAMP_MODULUS_V2;
} }
return ONLINE_TIMESTAMP_MODULUS_V1; return ONLINE_TIMESTAMP_MODULUS_V1;