From d69addc2fa9b5bd7fb17eecb67e56b4ec3eff699 Mon Sep 17 00:00:00 2001 From: Nicola Busanello Date: Thu, 25 Jan 2024 12:17:46 +0100 Subject: [PATCH] fix opret support in construct_psbt() --- src/pay.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pay.rs b/src/pay.rs index 4a3f734..2d62fa8 100644 --- a/src/pay.rs +++ b/src/pay.rs @@ -251,12 +251,10 @@ impl Runtime { } else { None }; - let output = psbt - .outputs_mut() + psbt.outputs_mut() .find(|o| o.script.is_p2tr() && Some(&o.script) != beneficiary_script.as_ref()) - .ok_or(CompositionError::TapretRequired)?; + .map(|o| o.set_tapret_host().expect("just created")); // TODO: Add descriptor id to the tapret host data - output.set_tapret_host().expect("just created"); let change_script = meta .change_vout