Skip to content

Commit 24d3011

Browse files
f ExactSizeIterator
1 parent 72dcd94 commit 24d3011

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lightning/src/blinded_path/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ pub(super) fn construct_blinded_hops<'a, T, I1, I2>(
111111
) -> Result<Vec<BlindedHop>, secp256k1::Error>
112112
where
113113
T: secp256k1::Signing + secp256k1::Verification,
114-
I1: Iterator<Item=&'a PublicKey>,
114+
I1: ExactSizeIterator<Item=&'a PublicKey>,
115115
I2: Iterator,
116116
I2::Item: Writeable
117117
{
118-
let mut blinded_hops = Vec::with_capacity(2); // We can't get the length of an Iterator without consuming it
118+
let mut blinded_hops = Vec::with_capacity(unblinded_pks.len());
119119
let mut curr_hop_idx = 0;
120120
construct_keys_callback(
121121
secp_ctx, unblinded_pks, None, session_priv,

0 commit comments

Comments
 (0)