Skip to content

Commit 15a70f1

Browse files
committed
Provide additional details in event hold_times documentation
1 parent 9be9c68 commit 15a70f1

File tree

1 file changed

+32
-10
lines changed

1 file changed

+32
-10
lines changed

lightning/src/events/mod.rs

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,11 +1102,22 @@ pub enum Event {
11021102
///
11031103
/// May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
11041104
path: Path,
1105-
/// The hold times as reported by each hop. The unit in which the hold times are expressed are 100's of
1106-
/// milliseconds. So a hop reporting 2 is a hold time that corresponds to roughly 200 milliseconds. As earlier
1107-
/// hops hold on to an HTLC for longer, the hold times in the list are expected to decrease. When our peer
1108-
/// didn't provide attribution data, the list is empty. The same applies to HTLCs that were resolved onchain.
1109-
/// Because of unavailability of hold times, the list may be shorter than the number of hops in the path.
1105+
/// The time that each hop indicated it held the HTLC.
1106+
///
1107+
/// The unit in which the hold times are expressed are 100's of milliseconds. So a hop
1108+
/// reporting 2 is a hold time that corresponds to between 200 and 299 milliseconds.
1109+
///
1110+
/// We expect that at each hop the actual hold time will be strictly greater than the hold
1111+
/// time of the following hops, as a node along the path shouldn't have completed the HTLC
1112+
/// until the next node has completed it. Note that because hold times are in 100's of ms,
1113+
/// hold times as reported are likely to often be equal across hops.
1114+
///
1115+
/// If our peer didn't provide attribution data or the HTLC resolved on chain, the list
1116+
/// will be empty.
1117+
///
1118+
/// Each entry will correspond with one entry in [`Path::hops`], or, thereafter, the
1119+
/// [`BlindedTail::trampoline_hops`] in [`Path::blinded_tail`]. Because not all nodes
1120+
/// support hold times, the list may be shorter than the number of hops in the path.
11101121
hold_times: Vec<u32>,
11111122
},
11121123
/// Indicates an outbound HTLC we sent failed, likely due to an intermediary node being unable to
@@ -1159,11 +1170,22 @@ pub enum Event {
11591170
error_code: Option<u16>,
11601171
#[cfg(any(test, feature = "_test_utils"))]
11611172
error_data: Option<Vec<u8>>,
1162-
/// The hold times as reported by each hop. The unit in which the hold times are expressed are 100's of
1163-
/// milliseconds. So a hop reporting 2 is a hold time that corresponds to roughly 200 milliseconds. As earlier
1164-
/// hops hold on to an HTLC for longer, the hold times in the list are expected to decrease. When our peer
1165-
/// didn't provide attribution data, the list is empty. The same applies to HTLCs that were resolved onchain.
1166-
/// Because of unavailability of hold times, the list may be shorter than the number of hops in the path.
1173+
/// The time that each hop indicated it held the HTLC.
1174+
///
1175+
/// The unit in which the hold times are expressed are 100's of milliseconds. So a hop
1176+
/// reporting 2 is a hold time that corresponds to between 200 and 299 milliseconds.
1177+
///
1178+
/// We expect that at each hop the actual hold time will be strictly greater than the hold
1179+
/// time of the following hops, as a node along the path shouldn't have completed the HTLC
1180+
/// until the next node has completed it. Note that because hold times are in 100's of ms,
1181+
/// hold times as reported are likely to often be equal across hops.
1182+
///
1183+
/// If our peer didn't provide attribution data or the HTLC resolved on chain, the list
1184+
/// will be empty.
1185+
///
1186+
/// Each entry will correspond with one entry in [`Path::hops`], or, thereafter, the
1187+
/// [`BlindedTail::trampoline_hops`] in [`Path::blinded_tail`]. Because not all nodes
1188+
/// support hold times, the list may be shorter than the number of hops in the path.
11671189
hold_times: Vec<u32>,
11681190
},
11691191
/// Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.

0 commit comments

Comments
 (0)