pub fn calc_mwc_block_overage(height: u64, genesis_had_reward: bool) -> u64 {
	let blocks_per_group = if global::is_floonet() {
		MWC_BLOCKS_PER_GROUP_FLOO
	} else {
		MWC_BLOCKS_PER_GROUP
	};

	// including this one happens implicitly.
	// Because "this block is included", but 0 block (genesis) block is excluded, we will keep height as it is
	let mut block_count = height;
	let mut reward_per_block = MWC_FIRST_GROUP_REWARD;
	let mut overage: u64 = GENESIS_BLOCK_REWARD; // genesis block reward

	for _x in 0..MWC_GROUPS_NUM {
		overage += min(block_count, blocks_per_group) * reward_per_block;
		reward_per_block /= 2;

		if block_count < blocks_per_group {
			break;
		}

		block_count -= blocks_per_group;
	}

	if !genesis_had_reward {
		// Deducting the first block reward if it is 0. This case is used into the tests.
		overage -= GENESIS_BLOCK_REWARD;
	}

	overage
}
/// MWC  calculate the total number of rewarded coins in all blocks including this one
MWC  calculate the total number of rewarded coins in all blocks including this one
MWC calculate the total number of rewarded coins in all blocks including this one
pub fn calc_mwc_block_overage(height: u64, genesis_had_reward: bool) -> u64 {
	let blocks_per_group = if global::is_floonet() {
		MWC_BLOCKS_PER_GROUP_FLOO
	} else {
		MWC_BLOCKS_PER_GROUP
	};
	// including this one happens implicitly.
	// Because "this block is included", but 0 block (genesis) block is excluded, we will keep height as it is
	let mut block_count = height;
	let mut reward_per_block = MWC_FIRST_GROUP_REWARD;
	let mut overage: u64 = GENESIS_BLOCK_REWARD; // genesis block reward
	for _x in 0..MWC_GROUPS_NUM {
		overage += min(block_count, blocks_per_group) * reward_per_block;
		reward_per_block /= 2;
		if block_count < blocks_per_group {
			break;
		}
		block_count -= blocks_per_group;
	}
	if !genesis_had_reward {
		// Deducting the first block reward if it is 0. This case is used into the tests.
		overage -= GENESIS_BLOCK_REWARD;
	}
	overage
}
pub fn calc_mwc_block_overage ( height : u64 , genesis_had_reward : bool ) -> u64 { let blocks_per_group = if global :: is_floonet ( ) { MWC_BLOCKS_PER_GROUP_FLOO } else { MWC_BLOCKS_PER_GROUP } ; // including this one happens implicitly. // Because "this block is included", but 0 block (genesis) block is excluded, we will keep height as it is let mut block_count = height ; let mut reward_per_block = MWC_FIRST_GROUP_REWARD ; let mut overage : u64 = GENESIS_BLOCK_REWARD ; // genesis block reward for _x in 0 .. MWC_GROUPS_NUM { overage += min ( block_count , blocks_per_group ) * reward_per_block ; reward_per_block /= 2 ; if block_count < blocks_per_group { break ; } block_count -= blocks_per_group ; } if ! genesis_had_reward { // Deducting the first block reward if it is 0. This case is used into the tests. overage -= GENESIS_BLOCK_REWARD ; } overage }
MWC  calculate the total number of rewarded coins in all blocks including this one
MWC calculate the total number of rewarded coins in all blocks including this one
height
u64
genesis_had_reward
bool
height
u64
genesis_had_reward
bool