X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fblinded_path%2Futils.rs;h=c62b4e6c2612cb52ee57321b747947d2100bd214;hb=971f7a7e42652d5697d761df6650ae9e6dcaa5db;hp=9b1ce50b10ebefa61943680694c5ce5852d20d43;hpb=d224f980ed208445d2425f697eb4563aaa432fa3;p=rust-lightning diff --git a/lightning/src/blinded_path/utils.rs b/lightning/src/blinded_path/utils.rs index 9b1ce50b..c62b4e6c 100644 --- a/lightning/src/blinded_path/utils.rs +++ b/lightning/src/blinded_path/utils.rs @@ -111,11 +111,11 @@ pub(super) fn construct_blinded_hops<'a, T, I1, I2>( ) -> Result, secp256k1::Error> where T: secp256k1::Signing + secp256k1::Verification, - I1: ExactSizeIterator, + I1: Iterator, I2: Iterator, I2::Item: Writeable { - let mut blinded_hops = Vec::with_capacity(unblinded_pks.len()); + let mut blinded_hops = Vec::with_capacity(unblinded_pks.size_hint().0); construct_keys_callback( secp_ctx, unblinded_pks, None, session_priv, |blinded_node_id, _, _, encrypted_payload_rho, _, _| { @@ -128,9 +128,9 @@ where } /// Encrypt TLV payload to be used as a [`crate::blinded_path::BlindedHop::encrypted_payload`]. -fn encrypt_payload(payload: P, encrypted_tlvs_ss: [u8; 32]) -> Vec { +fn encrypt_payload(payload: P, encrypted_tlvs_rho: [u8; 32]) -> Vec { let mut writer = VecWriter(Vec::new()); - let write_adapter = ChaChaPolyWriteAdapter::new(encrypted_tlvs_ss, &payload); + let write_adapter = ChaChaPolyWriteAdapter::new(encrypted_tlvs_rho, &payload); write_adapter.write(&mut writer).expect("In-memory writes cannot fail"); writer.0 }