Skip to content

Commit

Permalink
Fixed again.
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Sep 25, 2023
1 parent 13c347c commit b40b243
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/server/routes/indexer/computer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ export const computer: Router.Middleware = async (ctx) => {
await WasmStateEvent.findOne({
where: {
blockTimeUnixMs: {
[Op.gt]: 0,
[Op.lte]: time,
},
},
Expand All @@ -363,13 +364,14 @@ export const computer: Router.Middleware = async (ctx) => {
await WasmStateEvent.findOne({
where: {
blockTimeUnixMs: {
[Op.gt]: 0,
[Op.lte]: times[0],
},
},
order: [['blockTimeUnixMs', 'DESC']],
})
)?.block ??
// Use first block with a time set if no event exists before start time.
// Use first block if no event exists before start time.
(
await WasmStateEvent.findOne({
where: {
Expand All @@ -386,6 +388,7 @@ export const computer: Router.Middleware = async (ctx) => {
await WasmStateEvent.findOne({
where: {
blockTimeUnixMs: {
[Op.gt]: 0,
[Op.lte]: times[1],
},
},
Expand Down

0 comments on commit b40b243

Please sign in to comment.