From 961c5ea962d2879e218169aac091390e1f04ae7c Mon Sep 17 00:00:00 2001 From: CalDescent Date: Wed, 4 Aug 2021 09:22:17 +0100 Subject: [PATCH] Treat zero as null in sleepUntilHeight AT data. This is needed because we are unable to call setSleepUntilHeight() with a null value due to the datatype used in the CIYAM AT library. An alternate option would be to fork the AT library and use an Integer or Long rather than an int, but since we don't have a block zero, this is still a valid thing to check even when using that approach. --- src/main/java/org/qortal/at/QortalATAPI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/qortal/at/QortalATAPI.java b/src/main/java/org/qortal/at/QortalATAPI.java index 0e2ab389..c393a684 100644 --- a/src/main/java/org/qortal/at/QortalATAPI.java +++ b/src/main/java/org/qortal/at/QortalATAPI.java @@ -83,7 +83,7 @@ public class QortalATAPI extends API { // Quicker to check height, if sleep-until-height also active Integer sleepUntilHeight = this.atData.getSleepUntilHeight(); - boolean wakeDueToHeight = sleepUntilHeight != null && blockHeight >= sleepUntilHeight; + boolean wakeDueToHeight = sleepUntilHeight != null && sleepUntilHeight != 0 && blockHeight >= sleepUntilHeight; boolean wakeDueToMessage = false; if (!wakeDueToHeight) {