Skip to content

Commit

Permalink
Merge pull request #2949 from valentinewallace/2024-03-dont-write-emp…
Browse files Browse the repository at this point in the history
…ty-features

Only write `BlindedHopFeatures` if any features are set
  • Loading branch information
TheBlueMatt authored Mar 20, 2024
2 parents b747b39 + caccb1c commit 5c49358
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lightning/src/blinded_path/payment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,14 @@ impl TryFrom<CounterpartyForwardingInfo> for PaymentRelay {

impl Writeable for ForwardTlvs {
fn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
let features_opt =
if self.features == BlindedHopFeatures::empty() { None }
else { Some(&self.features) };
encode_tlv_stream!(w, {
(2, self.short_channel_id, required),
(10, self.payment_relay, required),
(12, self.payment_constraints, required),
(14, self.features, required)
(14, features_opt, option)
});
Ok(())
}
Expand Down

0 comments on commit 5c49358

Please sign in to comment.