pub fn evaluate_multi<'intp, F>(
        &mut self,
        verify_sig: F,
        pk: &'intp bitcoin::PublicKey,
    ) -> Option<Result<SatisfiedConstraint<'intp, 'txin>, Error>>
    where
        F: FnOnce(&bitcoin::PublicKey, ElementsSig) -> bool,
    {
        if let Some(witness_sig) = self.pop() {
            if let Element::Push(sigser) = witness_sig {
                let sig = verify_sersig(verify_sig, pk, sigser);
                match sig {
                    Ok(sig) => return Some(Ok(SatisfiedConstraint::PublicKey { key: pk, sig })),
                    Err(..) => {
                        self.push(witness_sig);
                        return None;
                    }
                }
            } else {
                Some(Err(Error::UnexpectedStackBoolean))
            }
        } else {
            Some(Err(Error::UnexpectedStackEnd))
        }
    }
/// Helper function to evaluate a checkmultisig which takes the top of the
/// stack as input signatures and validates it in order of pubkeys.
/// For example, if the first signature is satisfied by second public key,
/// other signatures are not checked against the first pubkey.
/// `multi(2,pk1,pk2)` would be satisfied by `[0 sig2 sig1]` and Err on
/// `[0 sig2 sig1]`
Helper function to evaluate a checkmultisig which takes the top of the
stack as input signatures and validates it in order of pubkeys.
For example, if the first signature is satisfied by second public key,
other signatures are not checked against the first pubkey.
Helper function to evaluate a checkmultisig which takes the top of the stack as input signatures and validates it in order of pubkeys . For example if the first signature is satisfied by second public key other signatures are not checked against the first pubkey .
pub fn evaluate_multi<'intp, F>(
        &mut self,
        verify_sig: F,
        pk: &'intp bitcoin::PublicKey,
    ) -> Option<Result<SatisfiedConstraint<'intp, 'txin>, Error>>
    where
        F: FnOnce(&bitcoin::PublicKey, ElementsSig) -> bool,
    {
        if let Some(witness_sig) = self.pop() {
            if let Element::Push(sigser) = witness_sig {
                let sig = verify_sersig(verify_sig, pk, sigser);
                match sig {
                    Ok(sig) => return Some(Ok(SatisfiedConstraint::PublicKey { key: pk, sig })),
                    Err(..) => {
                        self.push(witness_sig);
                        return None;
                    }
                }
            } else {
                Some(Err(Error::UnexpectedStackBoolean))
            }
        } else {
            Some(Err(Error::UnexpectedStackEnd))
        }
    }
pub fn evaluate_multi < ' intp , F > ( & mut self , verify_sig : F , pk : & ' intp bitcoin :: PublicKey , ) -> Option < Result < SatisfiedConstraint < ' intp , ' txin > , Error > > where F : FnOnce ( & bitcoin :: PublicKey , ElementsSig ) -> bool , { if let Some ( witness_sig ) = self . pop ( ) { if let Element :: Push ( sigser ) = witness_sig { let sig = verify_sersig ( verify_sig , pk , sigser ) ; match sig { Ok ( sig ) => return Some ( Ok ( SatisfiedConstraint :: PublicKey { key : pk , sig } ) ) , Err ( .. ) => { self . push ( witness_sig ) ; return None ; } } } else { Some ( Err ( Error :: UnexpectedStackBoolean ) ) } } else { Some ( Err ( Error :: UnexpectedStackEnd ) ) } }
Helper function to evaluate a checkmultisig which takes the top of the
stack as input signatures and validates it in order of pubkeys.
Helper function to evaluate a checkmultisig which takes the top of the stack as input signatures and validates it in order of pubkeys .
&mut self
verify_sig
F
pk
&'intp bitcoin::PublicKey
&mut self
verify_sig
F
pk
&'intp bitcoin::PublicKey