mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-25 07:17:40 +01:00
Merge pull request #1700 from TheBlueMatt/2022-09-missing-event-deser
Add missing deserialization of Event::HTLCHandlingFailed
This commit is contained in:
commit
a59b9d8079
1 changed files with 23 additions and 1 deletions
|
@ -1002,7 +1002,7 @@ impl MaybeReadable for Event {
|
||||||
(4, path, vec_type),
|
(4, path, vec_type),
|
||||||
(6, short_channel_id, option),
|
(6, short_channel_id, option),
|
||||||
});
|
});
|
||||||
Ok(Some(Event::ProbeFailed{
|
Ok(Some(Event::ProbeFailed {
|
||||||
payment_id,
|
payment_id,
|
||||||
payment_hash,
|
payment_hash,
|
||||||
path: path.unwrap(),
|
path: path.unwrap(),
|
||||||
|
@ -1011,6 +1011,28 @@ impl MaybeReadable for Event {
|
||||||
};
|
};
|
||||||
f()
|
f()
|
||||||
},
|
},
|
||||||
|
25u8 => {
|
||||||
|
let f = || {
|
||||||
|
let mut prev_channel_id = [0; 32];
|
||||||
|
let mut failed_next_destination_opt = None;
|
||||||
|
read_tlv_fields!(reader, {
|
||||||
|
(0, prev_channel_id, required),
|
||||||
|
(2, failed_next_destination_opt, ignorable),
|
||||||
|
});
|
||||||
|
if let Some(failed_next_destination) = failed_next_destination_opt {
|
||||||
|
Ok(Some(Event::HTLCHandlingFailed {
|
||||||
|
prev_channel_id,
|
||||||
|
failed_next_destination,
|
||||||
|
}))
|
||||||
|
} else {
|
||||||
|
// If we fail to read a `failed_next_destination` assume it's because
|
||||||
|
// `MaybeReadable::read` returned `Ok(None)`, though it's also possible we
|
||||||
|
// were simply missing the field.
|
||||||
|
Ok(None)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
f()
|
||||||
|
},
|
||||||
// Versions prior to 0.0.100 did not ignore odd types, instead returning InvalidValue.
|
// Versions prior to 0.0.100 did not ignore odd types, instead returning InvalidValue.
|
||||||
// Version 0.0.100 failed to properly ignore odd types, possibly resulting in corrupt
|
// Version 0.0.100 failed to properly ignore odd types, possibly resulting in corrupt
|
||||||
// reads.
|
// reads.
|
||||||
|
|
Loading…
Add table
Reference in a new issue