File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,14 @@ func (h *Signaller) shouldUpdatePrice(
286
286
newPrice uint64 ,
287
287
now time.Time ,
288
288
) bool {
289
+ // thresholdTime is the time when the price can be updated.
290
+ // add TimeBuffer to make sure the thresholdTime is not too early.
291
+ thresholdTime := time .Unix (valPrice .Timestamp + h .params .CooldownTime + TimeBuffer , 0 )
292
+
293
+ if thresholdTime .After (now ) {
294
+ return false
295
+ }
296
+
289
297
// Check if the price is past the assigned time, if it is, add it to the list of prices to update
290
298
assignedTime := calculateAssignedTime (
291
299
h .valAddress ,
@@ -295,11 +303,7 @@ func (h *Signaller) shouldUpdatePrice(
295
303
h .distributionStartPercentage ,
296
304
)
297
305
298
- // thresholdTime is the time when the price can be updated.
299
- // add TimeBuffer to make sure the thresholdTime is not too early.
300
- thresholdTime := time .Unix (valPrice .Timestamp + h .params .CooldownTime + TimeBuffer , 0 )
301
-
302
- if thresholdTime .Before (now ) && assignedTime .Before (now ) {
306
+ if assignedTime .Before (now ) {
303
307
return true
304
308
}
305
309
You can’t perform that action at this time.
0 commit comments