Remove Copy for flags parameter

This commit is contained in:
Riccardo Casatta 2021-05-01 10:19:54 +02:00
parent 3aaa5d6846
commit d1f4c0a5c8
No known key found for this signature in database
GPG Key ID: FD986A969E450397
1 changed files with 2 additions and 1 deletions

View File

@ -473,8 +473,9 @@ impl Transaction {
/// Verify that this transaction is able to spend its inputs /// Verify that this transaction is able to spend its inputs
/// The lambda spent should not return the same TxOut twice! /// The lambda spent should not return the same TxOut twice!
pub fn verify_with_flags<S, F>(&self, mut spent: S, flags: F) -> Result<(), script::Error> pub fn verify_with_flags<S, F>(&self, mut spent: S, flags: F) -> Result<(), script::Error>
where S: FnMut(&OutPoint) -> Option<TxOut>, F : Into<u32> + Copy { where S: FnMut(&OutPoint) -> Option<TxOut>, F : Into<u32> {
let tx = encode::serialize(&*self); let tx = encode::serialize(&*self);
let flags: u32 = flags.into();
for (idx, input) in self.input.iter().enumerate() { for (idx, input) in self.input.iter().enumerate() {
if let Some(output) = spent(&input.previous_output) { if let Some(output) = spent(&input.previous_output) {
output.script_pubkey.verify_with_flags(idx, output.value, tx.as_slice(), flags)?; output.script_pubkey.verify_with_flags(idx, output.value, tx.as_slice(), flags)?;