diff --git a/sql/bs.sql b/sql/bs.sql index 9c948f20..5c701067 100644 --- a/sql/bs.sql +++ b/sql/bs.sql @@ -20,7 +20,7 @@ BEGIN END IF; select max(height) from blocks where height < hi into hi0; - IF found THEN + IF NOT found THEN wi0 := -1; ELSE select workinfoid from blocks where height = hi0