@@ -101,7 +101,7 @@ fd_sysvar_epoch_rewards_set_inactive( fd_exec_slot_ctx_t * slot_ctx,
101
101
slot_ctx -> runtime_wksp );
102
102
}
103
103
104
- /* Create EpochRewards syavar with calculated rewards
104
+ /* Create EpochRewards sysvar with calculated rewards
105
105
106
106
https://github.com/anza-xyz/agave/blob/cbc8320d35358da14d79ebcada4dfb6756ffac79/runtime/src/bank/partitioned_epoch_rewards/sysvar.rs#L25 */
107
107
void
@@ -112,10 +112,6 @@ fd_sysvar_epoch_rewards_init( fd_exec_slot_ctx_t * slot_ctx,
112
112
ulong num_partitions ,
113
113
fd_point_value_t point_value ,
114
114
fd_hash_t const * last_blockhash ) {
115
- if ( FD_UNLIKELY ( total_rewards < distributed_rewards ) ) {
116
- FD_LOG_ERR (( "total rewards overflow" ));
117
- }
118
-
119
115
fd_sysvar_epoch_rewards_t epoch_rewards = {
120
116
.distribution_starting_block_height = distribution_starting_block_height ,
121
117
.num_partitions = num_partitions ,
@@ -133,6 +129,10 @@ fd_sysvar_epoch_rewards_init( fd_exec_slot_ctx_t * slot_ctx,
133
129
epoch_rewards .total_rewards = point_value .rewards ;
134
130
}
135
131
132
+ if ( FD_UNLIKELY ( epoch_rewards .total_rewards < distributed_rewards ) ) {
133
+ FD_LOG_ERR (( "total rewards overflow" ));
134
+ }
135
+
136
136
fd_memcpy ( & epoch_rewards .parent_blockhash , last_blockhash , FD_HASH_FOOTPRINT );
137
137
138
138
write_epoch_rewards ( slot_ctx , & epoch_rewards );
0 commit comments