Skip to content

skip extend reservation vote when reservation already expired#36

Open
nudiltoys-cmyk wants to merge 1 commit intoentrius:testfrom
nudiltoys-cmyk:fix/skip-expired-extend-vote
Open

skip extend reservation vote when reservation already expired#36
nudiltoys-cmyk wants to merge 1 commit intoentrius:testfrom
nudiltoys-cmyk:fix/skip-expired-extend-vote

Conversation

@nudiltoys-cmyk
Copy link
Copy Markdown

summary

I noticed _try_extend_reservation fires vote_extend_reservation even when the miner's reservation has already lapsed. the condition reserved_until < current_block + EXTEND_THRESHOLD_BLOCKS is true for any reserved_until behind current_block, so expired reservations trigger a contract call that gets rejected with NoReservation

changed the guard to 0 < blocks_left < EXTEND_THRESHOLD_BLOCKS so it only fires when the reservation is still alive but within the threshold window

test plan

verified the condition against blocks_left values of -5, 0, 1, 19, 20, 21, only 1 through 19 should trigger the extend vote

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant