mining reward checksum

This commit is contained in:
Hardhat Chad
2025-01-20 09:38:12 -08:00
parent 70a9d38e4d
commit cbe63c0d7d

View File

@@ -169,6 +169,16 @@ pub fn process_mine(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult {
let net_miner_boost_reward = net_boost_reward.checked_sub(net_staker_boost_reward).unwrap();
let net_miner_reward = net_base_reward.checked_add(net_miner_boost_reward).unwrap();
// Checksum on rewards
assert!(
net_reward == net_base_reward
.checked_add(net_miner_boost_reward)
.unwrap()
.checked_add(net_staker_boost_reward)
.unwrap(),
"Rewards checksum failed"
);
// Update bus balances.
//
// We track the theoretical rewards that would have been paid out ignoring the bus limit, so the