Go ahead and clone IVKs to limit borrowing hassles.

This commit is contained in:
Kris Nuttycombe 2021-07-30 11:45:01 -06:00
parent d8bf892c72
commit c803114bf6
1 changed files with 3 additions and 3 deletions

View File

@ -364,15 +364,15 @@ impl<T: Authorization, V> Bundle<T, V> {
/// along with the index of the action from which it was derived.
pub fn decrypt_outputs_for_keys<'a>(
&self,
keys: &[&'a IncomingViewingKey],
) -> Vec<(usize, &'a IncomingViewingKey, Note, Address, [u8; 512])> {
keys: &[IncomingViewingKey],
) -> Vec<(usize, IncomingViewingKey, Note, Address, [u8; 512])> {
self.actions
.iter()
.enumerate()
.filter_map(|(idx, action)| {
let domain = OrchardDomain::for_action(action);
keys.iter().find_map(move |ivk| {
try_note_decryption(&domain, ivk, action).map(|(n, a, m)| (idx, *ivk, n, a, m))
try_note_decryption(&domain, ivk, action).map(|(n, a, m)| (idx, ivk.clone(), n, a, m))
})
})
.collect()