.flat_map(|(txid,wtx)|{// flat_map because we're collecting vector of vectors
wtx.notes.iter()
.filter(|nd|nd.memo.is_none())// only get if memo is None (i.e., it has not been fetched)
.map(|nd|(txid.clone(),nd.memo.clone(),wtx.block))// collect (txid, memo, height) Clone everything because we want copies, so we can release the read lock
.collect::<Vec<(TxId,Option<Memo>,i32)>>()// convert to vector
})
.collect::<Vec<(TxId,Option<Memo>,i32)>>();
//println!("{:?}", txids_and_memos);
// TODO: Assert that all the memos here are None
txids_to_fetch=txids_and_memos.iter()
.map(|(txid,_,h)|(txid.clone(),*h))// We're only interested in the txids, so drop the Memo, which is None anyway
.collect::<Vec<(TxId,i32)>>();// and convert into Vec