Skip to content

Commit 2c273fa

Browse files
committed
f - Use optional_vec in Writeable for ReceiveTlvs
1 parent b0dce2a commit 2c273fa

File tree

1 file changed

+4
-1
lines changed
  • lightning/src/blinded_path

1 file changed

+4
-1
lines changed

lightning/src/blinded_path/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,12 @@ impl Writeable for ForwardTlvs {
224224

225225
impl Writeable for ReceiveTlvs {
226226
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), io::Error> {
227+
const EMPTY_PATH_ID: &Vec<u8> = &vec![];
228+
let path_id = self.path_id.as_ref().unwrap_or(EMPTY_PATH_ID);
229+
227230
// TODO: write padding
228231
encode_tlv_stream!(writer, {
229-
(6, self.path_id, (option, encoding: WithoutLength)),
232+
(6, *path_id, optional_vec),
230233
});
231234
Ok(())
232235
}

0 commit comments

Comments
 (0)