fn validate_input(&self, input: &Input) -> Result<(), Error> {
		if let Ok(pos) = self.batch.get_output_pos(&input.commitment()) {
			if let Some(hash) = self.pmmr.get_hash(pos) {
				if hash == input.hash_with_index(pos - 1) {
					return Ok(());
				}
			}
		}
		Err(ErrorKind::AlreadySpent(input.commitment()).into())
	}
// Input is valid if it is spending an (unspent) output
// that currently exists in the output MMR.
// Compare the hash in the output MMR at the expected pos.
Input is valid if it is spending an (unspent) output
that currently exists in the output MMR.
Compare the hash in the output MMR at the expected pos.
Input is valid if it is spending an ( unspent ) output that currently exists in the output MMR . Compare the hash in the output MMR at the expected pos .
fn validate_input(&self, input: &Input) -> Result<(), Error> {
		if let Ok(pos) = self.batch.get_output_pos(&input.commitment()) {
			if let Some(hash) = self.pmmr.get_hash(pos) {
				if hash == input.hash_with_index(pos - 1) {
					return Ok(());
				}
			}
		}
		Err(ErrorKind::AlreadySpent(input.commitment()).into())
	}
fn validate_input ( & self , input : & Input ) -> Result < ( ) , Error > { if let Ok ( pos ) = self . batch . get_output_pos ( & input . commitment ( ) ) { if let Some ( hash ) = self . pmmr . get_hash ( pos ) { if hash == input . hash_with_index ( pos - 1 ) { return Ok ( ( ) ) ; } } } Err ( ErrorKind :: AlreadySpent ( input . commitment ( ) ) . into ( ) ) }
Input is valid if it is spending an (unspent) output
that currently exists in the output MMR.
Input is valid if it is spending an ( unspent ) output that currently exists in the output MMR .
&self
input
&Input