Drop error handling in `handle_new_monitor_update`
[rust-lightning] / lightning / src / blinded_path / utils.rs
index 9b1ce50b10ebefa61943680694c5ce5852d20d43..c62b4e6c2612cb52ee57321b747947d2100bd214 100644 (file)
@@ -111,11 +111,11 @@ pub(super) fn construct_blinded_hops<'a, T, I1, I2>(
 ) -> Result<Vec<BlindedHop>, secp256k1::Error>
 where
        T: secp256k1::Signing + secp256k1::Verification,
-       I1: ExactSizeIterator<Item=&'a PublicKey>,
+       I1: Iterator<Item=&'a PublicKey>,
        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<P: Writeable>(payload: P, encrypted_tlvs_ss: [u8; 32]) -> Vec<u8> {
+fn encrypt_payload<P: Writeable>(payload: P, encrypted_tlvs_rho: [u8; 32]) -> Vec<u8> {
        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
 }