pub fn verify_coinbase(&self) -> Result<(), Error> {
		let cb_outs = self
			.body
			.outputs
			.iter()
			.filter(|out| out.is_coinbase())
			.collect::<Vec<&Output>>();

		let cb_kerns = self
			.body
			.kernels
			.iter()
			.filter(|kernel| kernel.is_coinbase())
			.collect::<Vec<&TxKernel>>();

		{
			let secp = static_secp_instance();
			let secp = secp.lock();
			let over_commit = secp.commit_value(reward(self.total_fees(), self.header.height))?;

			let out_adjust_sum =
				secp.commit_sum(map_vec!(cb_outs, |x| x.commitment()), vec![over_commit])?;

			let kerns_sum = secp.commit_sum(cb_kerns.iter().map(|x| x.excess).collect(), vec![])?;

			// Verify the kernel sum equals the output sum accounting for block fees.
			if kerns_sum != out_adjust_sum {
				return Err(Error::CoinbaseSumMismatch);
			}
		}

		Ok(())
	}
/// Validate the coinbase.body.outputs generated by miners.
/// Check the sum of coinbase-marked outputs match
/// the sum of coinbase-marked kernels accounting for fees.
Validate the coinbase.body.outputs generated by miners.
Check the sum of coinbase-marked outputs match
the sum of coinbase-marked kernels accounting for fees.
Validate the coinbase . body . outputs generated by miners . Check the sum of coinbase - marked outputs match the sum of coinbase - marked kernels accounting for fees .
pub fn verify_coinbase(&self) -> Result<(), Error> {
		let cb_outs = self
			.body
			.outputs
			.iter()
			.filter(|out| out.is_coinbase())
			.collect::<Vec<&Output>>();
		let cb_kerns = self
			.body
			.kernels
			.iter()
			.filter(|kernel| kernel.is_coinbase())
			.collect::<Vec<&TxKernel>>();
		{
			let secp = static_secp_instance();
			let secp = secp.lock();
			let over_commit = secp.commit_value(reward(self.total_fees(), self.header.height))?;
			let out_adjust_sum =
				secp.commit_sum(map_vec!(cb_outs, |x| x.commitment()), vec![over_commit])?;
			let kerns_sum = secp.commit_sum(cb_kerns.iter().map(|x| x.excess).collect(), vec![])?;
			// Verify the kernel sum equals the output sum accounting for block fees.
			if kerns_sum != out_adjust_sum {
				return Err(Error::CoinbaseSumMismatch);
			}
		}
		Ok(())
	}
pub fn verify_coinbase ( & self ) -> Result < ( ) , Error > { let cb_outs = self . body . outputs . iter ( ) . filter ( | out | out . is_coinbase ( ) ) . collect :: < Vec < & Output > > ( ) ; let cb_kerns = self . body . kernels . iter ( ) . filter ( | kernel | kernel . is_coinbase ( ) ) . collect :: < Vec < & TxKernel > > ( ) ; { let secp = static_secp_instance ( ) ; let secp = secp . lock ( ) ; let over_commit = secp . commit_value ( reward ( self . total_fees ( ) , self . header . height ) ) ? ; let out_adjust_sum = secp . commit_sum ( map_vec ! ( cb_outs x x commitment ( ) ) , vec ! [ over_commit ] ) ? ; let kerns_sum = secp . commit_sum ( cb_kerns . iter ( ) . map ( | x | x . excess ) . collect ( ) , vec ! [ ] ) ? ; // Verify the kernel sum equals the output sum accounting for block fees. if kerns_sum != out_adjust_sum { return Err ( Error :: CoinbaseSumMismatch ) ; } } Ok ( ( ) ) }
Validate the coinbase.body.outputs generated by miners.
Validate the coinbase . body . outputs generated by miners .
&self
&self