Skip to content

Commit 55643b6

Browse files
committed
f - Use vec_type for path serialization
1 parent d1b38e8 commit 55643b6

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lightning/src/util/events.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ impl Writeable for Event {
462462
write_tlv_fields!(writer, {
463463
(0, payment_id, required),
464464
(2, payment_hash, option),
465-
(4, VecWriteWrapper(path), required)
465+
(4, path, vec_type)
466466
})
467467
},
468468
// Note that, going forward, all new events must only write data inside of
@@ -631,13 +631,17 @@ impl MaybeReadable for Event {
631631
let f = || {
632632
let mut payment_id = PaymentId([0; 32]);
633633
let mut payment_hash = None;
634-
let mut path = VecReadWrapper(Vec::new());
634+
let mut path: Option<Vec<RouteHop>> = Some(vec![]);
635635
read_tlv_fields!(reader, {
636636
(0, payment_id, required),
637637
(2, payment_hash, option),
638-
(4, path, required),
638+
(4, path, vec_type),
639639
});
640-
Ok(Some(Event::PaymentPathSuccessful { payment_id, payment_hash, path: path.0 } ))
640+
Ok(Some(Event::PaymentPathSuccessful {
641+
payment_id,
642+
payment_hash,
643+
path: path.unwrap(),
644+
}))
641645
};
642646
f()
643647
},

0 commit comments

Comments
 (0)