diff --git a/src/main/java/org/qortal/api/model/NodeStatus.java b/src/main/java/org/qortal/api/model/NodeStatus.java index 9d08bb14..ab5e766e 100644 --- a/src/main/java/org/qortal/api/model/NodeStatus.java +++ b/src/main/java/org/qortal/api/model/NodeStatus.java @@ -4,6 +4,7 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import org.qortal.controller.Controller; +import org.qortal.controller.OnlineAccountsManager; import org.qortal.controller.Synchronizer; import org.qortal.network.Network; @@ -21,7 +22,7 @@ public class NodeStatus { public final int height; public NodeStatus() { - this.isMintingPossible = Controller.getInstance().isMintingPossible(); + this.isMintingPossible = OnlineAccountsManager.getInstance().hasActiveOnlineAccountSignatures(); this.syncPercent = Synchronizer.getInstance().getSyncPercent(); this.isSynchronizing = Synchronizer.getInstance().isSynchronizing(); diff --git a/src/main/java/org/qortal/api/resource/AdminResource.java b/src/main/java/org/qortal/api/resource/AdminResource.java index bf7294ab..8a9d8025 100644 --- a/src/main/java/org/qortal/api/resource/AdminResource.java +++ b/src/main/java/org/qortal/api/resource/AdminResource.java @@ -125,12 +125,12 @@ public class AdminResource { } private String getNodeType() { - if (Settings.getInstance().isTopOnly()) { - return "topOnly"; - } - else if (Settings.getInstance().isLite()) { + if (Settings.getInstance().isLite()) { return "lite"; } + else if (Settings.getInstance().isTopOnly()) { + return "topOnly"; + } else { return "full"; } diff --git a/src/main/java/org/qortal/controller/OnlineAccountsManager.java b/src/main/java/org/qortal/controller/OnlineAccountsManager.java index 52d3b5fa..529cc853 100644 --- a/src/main/java/org/qortal/controller/OnlineAccountsManager.java +++ b/src/main/java/org/qortal/controller/OnlineAccountsManager.java @@ -55,7 +55,7 @@ public class OnlineAccountsManager { private static final long ONLINE_ACCOUNTS_BROADCAST_INTERVAL = 15 * 1000L; // ms private static final long ONLINE_ACCOUNTS_V2_PEER_VERSION = 0x0300020000L; // v3.2.0 - private static final long ONLINE_ACCOUNTS_V3_PEER_VERSION = 0x03000300cbL; // v3.3.203 + private static final long ONLINE_ACCOUNTS_V3_PEER_VERSION = 0x0300040000L; // v3.4.0 private final ScheduledExecutorService executor = Executors.newScheduledThreadPool(4, new NamedThreadFactory("OnlineAccounts")); private volatile boolean isStopping = false; @@ -471,6 +471,18 @@ public class OnlineAccountsManager { return this.currentOnlineAccounts.containsKey(onlineAccountsTimestamp); } + /** + * Whether we have submitted - or attempted to submit - our online account + * signature(s) to the network. + * @return true if our signature(s) have been submitted recently. + */ + public boolean hasActiveOnlineAccountSignatures() { + final Long minLatestBlockTimestamp = NTP.getTime() - (2 * 60 * 60 * 1000L); + boolean isUpToDate = Controller.getInstance().isUpToDate(minLatestBlockTimestamp); + + return isUpToDate && hasOnlineAccounts(); + } + public boolean hasOurOnlineAccounts() { return this.hasOurOnlineAccounts; }