Skip to content

Reduce attribution data hold time resolution to 100 ms #3868

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lightning-background-processor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2699,6 +2699,7 @@ mod tests {
short_channel_id: Some(scored_scid),
error_code: None,
error_data: None,
hold_times: Vec::new(),
});
let event = $receive.expect("PaymentPathFailed not handled within deadline");
match event {
Expand All @@ -2718,6 +2719,7 @@ mod tests {
short_channel_id: None,
error_code: None,
error_data: None,
hold_times: Vec::new(),
});
let event = $receive.expect("PaymentPathFailed not handled within deadline");
match event {
Expand Down
10 changes: 10 additions & 0 deletions lightning/src/events/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,8 @@ pub enum Event {
error_code: Option<u16>,
#[cfg(any(test, feature = "_test_utils"))]
error_data: Option<Vec<u8>>,
#[cfg(any(test, feature = "_test_utils"))]
hold_times: Vec<u32>,
},
/// Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
///
Expand Down Expand Up @@ -1696,12 +1698,16 @@ impl Writeable for Event {
ref error_code,
#[cfg(any(test, feature = "_test_utils"))]
ref error_data,
#[cfg(any(test, feature = "_test_utils"))]
ref hold_times,
} => {
3u8.write(writer)?;
#[cfg(any(test, feature = "_test_utils"))]
error_code.write(writer)?;
#[cfg(any(test, feature = "_test_utils"))]
error_data.write(writer)?;
#[cfg(any(test, feature = "_test_utils"))]
hold_times.write(writer)?;
write_tlv_fields!(writer, {
(0, payment_hash, required),
(1, None::<NetworkUpdate>, option), // network_update in LDK versions prior to 0.0.114
Expand Down Expand Up @@ -2121,6 +2127,8 @@ impl MaybeReadable for Event {
let error_code = Readable::read(reader)?;
#[cfg(any(test, feature = "_test_utils"))]
let error_data = Readable::read(reader)?;
#[cfg(any(test, feature = "_test_utils"))]
let hold_times = Readable::read(reader)?;
let mut payment_hash = PaymentHash([0; 32]);
let mut payment_failed_permanently = false;
let mut network_update = None;
Expand Down Expand Up @@ -2154,6 +2162,8 @@ impl MaybeReadable for Event {
error_code,
#[cfg(any(test, feature = "_test_utils"))]
error_data,
#[cfg(any(test, feature = "_test_utils"))]
hold_times,
}))
};
f()
Expand Down
Loading
Loading