]> git.bitcoin.ninja Git - rust-lightning/commit
Refactor helper macro from construct_keys_callback
authorJeffrey Czyz <jkczyz@gmail.com>
Thu, 15 Aug 2024 22:36:55 +0000 (17:36 -0500)
committerJeffrey Czyz <jkczyz@gmail.com>
Tue, 20 Aug 2024 21:00:19 +0000 (16:00 -0500)
commit8d22f997407f0cf65442ee29369b01d5974513b6
treea26113c25cadb3d2ad429e3cbd20b337ca17d107
parentbbfa15eb18faf4ca67986d7935d179c0526b1881
Refactor helper macro from construct_keys_callback

When constructing a BlindedPath, utils::construct_blinded_hops uses two
iterators. However, this makes it difficult to pad blinded hops to equal
sizes without allocating a vector or cloning data. Refactor the
construct_keys_callback utility function so that is can be used with an
Iterator with different Item types. This allows using a single Iterator
of tuples while still supporting its use only with pubkeys.
lightning/src/blinded_path/utils.rs