Skip to content

Commit e28147b

Browse files
two-heartmjain-jump
authored andcommitted
1 parent 4e08a15 commit e28147b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/flamenco/runtime/sysvar/fd_sysvar_epoch_rewards.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ fd_sysvar_epoch_rewards_set_inactive( fd_exec_slot_ctx_t * slot_ctx,
101101
slot_ctx->runtime_wksp );
102102
}
103103

104-
/* Create EpochRewards syavar with calculated rewards
104+
/* Create EpochRewards sysvar with calculated rewards
105105
106106
https://github.com/anza-xyz/agave/blob/cbc8320d35358da14d79ebcada4dfb6756ffac79/runtime/src/bank/partitioned_epoch_rewards/sysvar.rs#L25 */
107107
void
@@ -112,10 +112,6 @@ fd_sysvar_epoch_rewards_init( fd_exec_slot_ctx_t * slot_ctx,
112112
ulong num_partitions,
113113
fd_point_value_t point_value,
114114
fd_hash_t const * last_blockhash ) {
115-
if( FD_UNLIKELY( total_rewards < distributed_rewards ) ) {
116-
FD_LOG_ERR(( "total rewards overflow" ));
117-
}
118-
119115
fd_sysvar_epoch_rewards_t epoch_rewards = {
120116
.distribution_starting_block_height = distribution_starting_block_height,
121117
.num_partitions = num_partitions,
@@ -133,6 +129,10 @@ fd_sysvar_epoch_rewards_init( fd_exec_slot_ctx_t * slot_ctx,
133129
epoch_rewards.total_rewards = point_value.rewards;
134130
}
135131

132+
if( FD_UNLIKELY( epoch_rewards.total_rewards<distributed_rewards ) ) {
133+
FD_LOG_ERR(( "total rewards overflow" ));
134+
}
135+
136136
fd_memcpy( &epoch_rewards.parent_blockhash, last_blockhash, FD_HASH_FOOTPRINT );
137137

138138
write_epoch_rewards( slot_ctx, &epoch_rewards );

0 commit comments

Comments
 (0)