Function solana_stake_program::stake_state::calculate_stake_rewards
source · fn calculate_stake_rewards(
rewarded_epoch: Epoch,
stake: &Stake,
point_value: &PointValue,
vote_state: &VoteState,
stake_history: Option<&StakeHistory>,
inflation_point_calc_tracer: Option<impl Fn(&InflationPointCalculationEvent)>,
credits_auto_rewind: bool
) -> Option<CalculatedStakeRewards>
Expand description
for a given stake and vote_state, calculate what distributions and what updates should be made returns a tuple in the case of a payout of:
- staker_rewards to be distributed
- voter_rewards to be distributed
- new value for credits_observed in the stake returns None if there’s no payout or if any deserved payout is < 1 lamport