pub fn calc_mwc_block_reward(height: u64) -> u64 {
	if height == 0 {
		// Genesis block
		return GENESIS_BLOCK_REWARD;
	}

	// Excluding the genesis block from any group
	let group_num = if global::is_floonet() {
		(height - 1) / MWC_BLOCKS_PER_GROUP_FLOO
	} else {
		(height - 1) / MWC_BLOCKS_PER_GROUP
	};

	if group_num >= MWC_GROUPS_NUM {
		0 // far far future, no rewards, sorry
	} else {
		let start_reward = MWC_FIRST_GROUP_REWARD;
		let group_div = 1 << group_num;
		start_reward / group_div
	}
}
/// Calculate MWC block reward. The scedure is similar to bitcoints.
/// 1st 2.1 million blocks - 2.38095238 MWC
/// 2nd 2.1 million blocks - 1.19047619 MWC
/// 3rd 2.1 million blocks - 0.59523809 MWC
/// 4th 2.1 million blocks - 0.29761904 MWC
/// 5th 2.1 million blocks - 0.14880952 MWC
/// 6th 2.1 million blocks - 0.07440476 MWC
// ...
/// 32nd 2.1 million blocks - 0.000000001 MWC
//All blocks after that - 0 MWC (miner fees only)
Calculate MWC block reward. The scedure is similar to bitcoints.
Calculate MWC block reward . The scedure is similar to bitcoints .
pub fn calc_mwc_block_reward(height: u64) -> u64 {
	if height == 0 {
		// Genesis block
		return GENESIS_BLOCK_REWARD;
	}
	// Excluding the genesis block from any group
	let group_num = if global::is_floonet() {
		(height - 1) / MWC_BLOCKS_PER_GROUP_FLOO
	} else {
		(height - 1) / MWC_BLOCKS_PER_GROUP
	};
	if group_num >= MWC_GROUPS_NUM {
		0 // far far future, no rewards, sorry
	} else {
		let start_reward = MWC_FIRST_GROUP_REWARD;
		let group_div = 1 << group_num;
		start_reward / group_div
	}
}
pub fn calc_mwc_block_reward ( height : u64 ) -> u64 { if height == 0 { // Genesis block return GENESIS_BLOCK_REWARD ; } // Excluding the genesis block from any group let group_num = if global :: is_floonet ( ) { ( height - 1 ) / MWC_BLOCKS_PER_GROUP_FLOO } else { ( height - 1 ) / MWC_BLOCKS_PER_GROUP } ; if group_num >= MWC_GROUPS_NUM { 0 // far far future, no rewards, sorry } else { let start_reward = MWC_FIRST_GROUP_REWARD ; let group_div = 1 << group_num ; start_reward / group_div } }
Calculate MWC block reward.
Calculate MWC block reward .
height
u64
height
u64