@@ -1609,17 +1609,17 @@ mod tests {
1609
1609
let router = TestRouter { } ;
1610
1610
let scorer = RefCell :: new ( TestScorer :: new ( )
1611
1611
// 1st invoice, 1st path
1612
- . expect_usage ( ChannelUsage { amount_msat : 10 , inflight_htlc_msat : 0 , effective_capacity : EffectiveCapacity :: Unknown } )
1613
- . expect_usage ( ChannelUsage { amount_msat : 20 , inflight_htlc_msat : 0 , effective_capacity : EffectiveCapacity :: Unknown } )
1614
- . expect_usage ( ChannelUsage { amount_msat : 64 , inflight_htlc_msat : 0 , effective_capacity : EffectiveCapacity :: Unknown } )
1612
+ . expect_usage ( ChannelUsage { amount_msat : 10 , inflight_htlc_msat : 10 , effective_capacity : EffectiveCapacity :: Unknown } )
1613
+ . expect_usage ( ChannelUsage { amount_msat : 20 , inflight_htlc_msat : 20 , effective_capacity : EffectiveCapacity :: Unknown } )
1614
+ . expect_usage ( ChannelUsage { amount_msat : 64 , inflight_htlc_msat : 64 , effective_capacity : EffectiveCapacity :: Unknown } )
1615
1615
// 1st invoice, 2nd path
1616
- . expect_usage ( ChannelUsage { amount_msat : 64 , inflight_htlc_msat : 0 , effective_capacity : EffectiveCapacity :: Unknown } )
1616
+ . expect_usage ( ChannelUsage { amount_msat : 64 , inflight_htlc_msat : 64 , effective_capacity : EffectiveCapacity :: Unknown } )
1617
1617
// 2nd invoice, 1st path
1618
- . expect_usage ( ChannelUsage { amount_msat : 10 , inflight_htlc_msat : 0 , effective_capacity : EffectiveCapacity :: Unknown } )
1619
- . expect_usage ( ChannelUsage { amount_msat : 20 , inflight_htlc_msat : 0 , effective_capacity : EffectiveCapacity :: Unknown } )
1620
- . expect_usage ( ChannelUsage { amount_msat : 64 , inflight_htlc_msat : 0 , effective_capacity : EffectiveCapacity :: Unknown } )
1618
+ . expect_usage ( ChannelUsage { amount_msat : 10 , inflight_htlc_msat : 10 , effective_capacity : EffectiveCapacity :: Unknown } )
1619
+ . expect_usage ( ChannelUsage { amount_msat : 20 , inflight_htlc_msat : 84 , effective_capacity : EffectiveCapacity :: Unknown } )
1620
+ . expect_usage ( ChannelUsage { amount_msat : 64 , inflight_htlc_msat : 64 , effective_capacity : EffectiveCapacity :: Unknown } )
1621
1621
// 2nd invoice, 2nd path
1622
- . expect_usage ( ChannelUsage { amount_msat : 128 , inflight_htlc_msat : 0 , effective_capacity : EffectiveCapacity :: Unknown } )
1622
+ . expect_usage ( ChannelUsage { amount_msat : 64 , inflight_htlc_msat : 128 , effective_capacity : EffectiveCapacity :: Unknown } )
1623
1623
) ;
1624
1624
let logger = TestLogger :: new ( ) ;
1625
1625
let invoice_payer =
@@ -1714,7 +1714,7 @@ mod tests {
1714
1714
for hop in path {
1715
1715
let usage = ChannelUsage {
1716
1716
amount_msat : hop. fee_msat ,
1717
- inflight_htlc_msat : 0 ,
1717
+ inflight_htlc_msat : hop . fee_msat ,
1718
1718
effective_capacity : EffectiveCapacity :: Unknown ,
1719
1719
} ;
1720
1720
scorer. channel_penalty_msat ( hop. short_channel_id , & NodeId :: from_pubkey ( payer) , & NodeId :: from_pubkey ( & hop. pubkey ) , usage) ;
@@ -1782,6 +1782,7 @@ mod tests {
1782
1782
match self . scorer_expectations . borrow_mut ( ) . pop_front ( ) {
1783
1783
Some ( expectation) => {
1784
1784
assert_eq ! ( expectation. amount_msat, usage. amount_msat) ;
1785
+ assert_eq ! ( expectation. inflight_htlc_msat, usage. inflight_htlc_msat) ;
1785
1786
} ,
1786
1787
None => { } ,
1787
1788
}
0 commit comments