Skip to content

Commit

Permalink
Fix genesis end setting on delegate (#619)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChewingGlass authored Mar 22, 2024
1 parent 2c9240b commit 68da8e3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ pub fn handler(ctx: Context<DelegateV0>) -> Result<()> {

let genesis_end_is_closing = ctx.accounts.genesis_end_sub_dao_epoch_info.key()
== ctx.accounts.closing_time_sub_dao_epoch_info.key();
if genesis_end_fall_rate_correction > 0 || genesis_end_vehnt_correction > 0 {
if position.genesis_end > curr_ts
&& (genesis_end_fall_rate_correction > 0 || genesis_end_vehnt_correction > 0)
{
// If the end account doesn't exist, init it. Otherwise just set the correcitons
if !genesis_end_is_closing && ctx.accounts.genesis_end_sub_dao_epoch_info.data_len() == 0 {
msg!("Genesis end doesn't exist, initting");
Expand Down

0 comments on commit 68da8e3

Please sign in to comment.