Commit 1bcc4c1 1 parent 8b3b844 commit 1bcc4c1 Copy full SHA for 1bcc4c1
File tree 1 file changed +7
-8
lines changed
1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -1066,18 +1066,17 @@ export class PgStore extends BasePgStore {
1066
1066
received_at : Date | null ;
1067
1067
} [ ]
1068
1068
> `
1069
- WITH last_confirmed_height AS (
1070
- SELECT GREATEST(
1071
- COALESCE(MAX(b.block_height), 0),
1072
- COALESCE(MAX(bp.block_height), 0)
1073
- ) AS height
1074
- FROM blocks b
1075
- LEFT JOIN block_pushes bp ON true
1069
+ WITH max_heights AS (
1070
+ SELECT
1071
+ GREATEST(
1072
+ (SELECT COALESCE(MAX(block_height), 0) FROM blocks),
1073
+ (SELECT COALESCE(MAX(block_height), 0) FROM block_pushes)
1074
+ ) AS height
1076
1075
),
1077
1076
oldest_pending_proposal AS (
1078
1077
SELECT received_at
1079
1078
FROM block_proposals bp
1080
- WHERE bp.block_height > (SELECT height FROM last_confirmed_height )
1079
+ WHERE bp.block_height > (SELECT height FROM max_heights )
1081
1080
ORDER BY received_at ASC
1082
1081
LIMIT 1
1083
1082
)
You can’t perform that action at this time.
0 commit comments