Skip to content

Commit 703d8c8

Browse files
author
ff
committed
Added a function which adds inflight HTLCs to InFlightHtlcs-struct, which is used by router
One would use that function if he would get data from for example c-lightning (https://lightning.readthedocs.io/lightning-listhtlcs.7.html), and would like to use that with ldk's router
1 parent 945d4c8 commit 703d8c8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lightning/src/routing/router.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,15 +218,15 @@ impl InFlightHtlcs {
218218
}
219219
}
220220

221-
/// Adds a known htlc given the public key of the HTLC source, target, and short channel
221+
/// Adds a known HTLC given the public key of the HTLC source, target, and short channel
222222
/// id.
223223
pub fn add_inflight_htlc(&mut self, source: &NodeId, target: &NodeId, channel_scid: u64, used_msat: u64){
224-
self.0.entry((channel_scid, source < target))
225-
.and_modify(|used_liquidity_msat| *used_liquidity_msat += used_msat)
226-
.or_insert(used_msat);
224+
self.0
225+
.entry((channel_scid, source < target))
226+
.and_modify(|used_liquidity_msat| *used_liquidity_msat += used_msat)
227+
.or_insert(used_msat);
227228
}
228229

229-
230230
/// Returns liquidity in msat given the public key of the HTLC source, target, and short channel
231231
/// id.
232232
pub fn used_liquidity_msat(&self, source: &NodeId, target: &NodeId, channel_scid: u64) -> Option<u64> {

0 commit comments

Comments
 (0)