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/controller/OnlineAccountsManager.java b/src/main/java/org/qortal/controller/OnlineAccountsManager.java index ad610f7a..1e476a4a 100644 --- a/src/main/java/org/qortal/controller/OnlineAccountsManager.java +++ b/src/main/java/org/qortal/controller/OnlineAccountsManager.java @@ -462,6 +462,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; }