Skip to content

Commit dbd8451

Browse files
authored
Merge pull request #3868 from joostjager/coarse-hold-times
Reduce attribution data hold time resolution to 100 ms
2 parents bed20cf + 1fc1a14 commit dbd8451

File tree

8 files changed

+1868
-675
lines changed

8 files changed

+1868
-675
lines changed

lightning-background-processor/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2699,6 +2699,7 @@ mod tests {
26992699
short_channel_id: Some(scored_scid),
27002700
error_code: None,
27012701
error_data: None,
2702+
hold_times: Vec::new(),
27022703
});
27032704
let event = $receive.expect("PaymentPathFailed not handled within deadline");
27042705
match event {
@@ -2718,6 +2719,7 @@ mod tests {
27182719
short_channel_id: None,
27192720
error_code: None,
27202721
error_data: None,
2722+
hold_times: Vec::new(),
27212723
});
27222724
let event = $receive.expect("PaymentPathFailed not handled within deadline");
27232725
match event {

lightning/src/events/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,6 +1131,8 @@ pub enum Event {
11311131
error_code: Option<u16>,
11321132
#[cfg(any(test, feature = "_test_utils"))]
11331133
error_data: Option<Vec<u8>>,
1134+
#[cfg(any(test, feature = "_test_utils"))]
1135+
hold_times: Vec<u32>,
11341136
},
11351137
/// Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
11361138
///
@@ -1696,12 +1698,16 @@ impl Writeable for Event {
16961698
ref error_code,
16971699
#[cfg(any(test, feature = "_test_utils"))]
16981700
ref error_data,
1701+
#[cfg(any(test, feature = "_test_utils"))]
1702+
ref hold_times,
16991703
} => {
17001704
3u8.write(writer)?;
17011705
#[cfg(any(test, feature = "_test_utils"))]
17021706
error_code.write(writer)?;
17031707
#[cfg(any(test, feature = "_test_utils"))]
17041708
error_data.write(writer)?;
1709+
#[cfg(any(test, feature = "_test_utils"))]
1710+
hold_times.write(writer)?;
17051711
write_tlv_fields!(writer, {
17061712
(0, payment_hash, required),
17071713
(1, None::<NetworkUpdate>, option), // network_update in LDK versions prior to 0.0.114
@@ -2121,6 +2127,8 @@ impl MaybeReadable for Event {
21212127
let error_code = Readable::read(reader)?;
21222128
#[cfg(any(test, feature = "_test_utils"))]
21232129
let error_data = Readable::read(reader)?;
2130+
#[cfg(any(test, feature = "_test_utils"))]
2131+
let hold_times = Readable::read(reader)?;
21242132
let mut payment_hash = PaymentHash([0; 32]);
21252133
let mut payment_failed_permanently = false;
21262134
let mut network_update = None;
@@ -2154,6 +2162,8 @@ impl MaybeReadable for Event {
21542162
error_code,
21552163
#[cfg(any(test, feature = "_test_utils"))]
21562164
error_data,
2165+
#[cfg(any(test, feature = "_test_utils"))]
2166+
hold_times,
21572167
}))
21582168
};
21592169
f()

0 commit comments

Comments
 (0)