Skip to content

Commit 08ed922

Browse files
committed
Use refs instead of clone in PSBT finalizer prevouts fn
1 parent b291d27 commit 08ed922

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/psbt/finalizer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ pub(super) fn get_utxo(psbt: &Psbt, index: usize) -> Result<&bitcoin::TxOut, Inp
117117
}
118118

119119
/// Get the Prevouts for the psbt
120-
pub(super) fn prevouts<'a>(psbt: &'a Psbt) -> Result<Vec<bitcoin::TxOut>, super::Error> {
120+
pub(super) fn prevouts<'a>(psbt: &'a Psbt) -> Result<Vec<&bitcoin::TxOut>, super::Error> {
121121
let mut utxos = vec![];
122122
for i in 0..psbt.inputs.len() {
123123
let utxo_ref = get_utxo(psbt, i).map_err(|e| Error::InputError(e, i))?;
124-
utxos.push(utxo_ref.clone()); // RC fix would allow references here instead of clone
124+
utxos.push(utxo_ref);
125125
}
126126
Ok(utxos)
127127
}

0 commit comments

Comments
 (0)