timestamp: Timestamp::Now,
active: Some(false),
range: None,
next_index: None,
internal: Some(false),
label: Some("commit tx recovery key".to_string()),
})?;
for result in response {
if !result.success {
return Err(anyhow!("commit tx recovery key import failed"));
}
}
Ok(())
}
fn build_reveal_transaction(
control_block: &ControlBlock,
fee_rate: FeeRate,
inputs: Vec<OutPoint>,
commit_input_index: usize,
outputs: Vec<TxOut>,
script: &Script,
) -> (Transaction, Amount) {
let reveal_tx = Transaction {
input: inputs
.iter()
.map(|outpoint| TxIn {
previous_output: *outpoint,
script_sig: script::Builder::new().into_script(),
witness: Witness::new(),
sequence: Sequence::ENABLE_RBF_NO_LOCKTIME,
})
.collect(),
output: outputs,
lock_time: LockTime::ZERO,
version: 1,
};
let fee = {
let mut reveal_tx = reveal_tx.clone();