X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Futil%2Fevents.rs;h=9f7f4b4e5e00130a3581c5dd397497b3be0ba8ff;hb=79541b11e8b6e62de0fc613f416e30bf1de5f3d9;hp=08fc164f4baf10f8a2240a64e09d6bd77b8fa165;hpb=5a356cad694c12d1e4aa3ab60602ae087fc53d9a;p=rust-lightning diff --git a/lightning/src/util/events.rs b/lightning/src/util/events.rs index 08fc164f..9f7f4b4e 100644 --- a/lightning/src/util/events.rs +++ b/lightning/src/util/events.rs @@ -208,6 +208,11 @@ pub enum Event { all_paths_failed: bool, /// The payment path that failed. path: Vec, + /// The channel responsible for the failed payment path. + /// + /// If this is `Some`, then the corresponding channel should be avoided when the payment is + /// retried. May be `None` for older [`Event`] serializations. + short_channel_id: Option, #[cfg(test)] error_code: Option, #[cfg(test)] @@ -309,7 +314,7 @@ impl Writeable for Event { }); }, &Event::PaymentPathFailed { ref payment_hash, ref rejected_by_dest, ref network_update, - ref all_paths_failed, ref path, + ref all_paths_failed, ref path, ref short_channel_id, #[cfg(test)] ref error_code, #[cfg(test)] @@ -326,6 +331,7 @@ impl Writeable for Event { (2, rejected_by_dest, required), (3, all_paths_failed, required), (5, path, vec_type), + (7, short_channel_id, option), }); }, &Event::PendingHTLCsForwardable { time_forwardable: _ } => { @@ -435,12 +441,14 @@ impl MaybeReadable for Event { let mut network_update = None; let mut all_paths_failed = Some(true); let mut path: Option> = Some(vec![]); + let mut short_channel_id = None; read_tlv_fields!(reader, { (0, payment_hash, required), (1, network_update, ignorable), (2, rejected_by_dest, required), (3, all_paths_failed, option), (5, path, vec_type), + (7, short_channel_id, ignorable), }); Ok(Some(Event::PaymentPathFailed { payment_hash, @@ -448,6 +456,7 @@ impl MaybeReadable for Event { network_update, all_paths_failed: all_paths_failed.unwrap(), path: path.unwrap(), + short_channel_id, #[cfg(test)] error_code, #[cfg(test)]