Skip to content

Commit d0085fd

Browse files
committed
Expose skimmed_fee_msat in PaymentForwarded
We generally allow routing nodes to forward less than the expected HTLC amount, if the receiver knowingly accepts this and claims the underpaying HTLC (see `ChannelConfig::accept_underpaying_htlcs`). This use case is in particular useful for the LSPS2/JIT channel setting where the intial underpaying HTLC pays for the channel open. While we previously exposed the withheld amount as `PaymentClaimable::counterparty_skimmed_fee_msat` on the receiver side, we did not individually provide it on the forwarding node's side. Here, we therefore expose this additionally withheld amount via `PaymentForwarded::skimmed_fee_msat`.
1 parent 51d9ee3 commit d0085fd

10 files changed

+74
-39
lines changed

lightning/src/events/mod.rs

+18-3
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ pub enum Event {
783783
/// The outgoing channel between the next node and us. This is only `None` for events
784784
/// generated or serialized by versions prior to 0.0.107.
785785
next_channel_id: Option<ChannelId>,
786-
/// The fee, in milli-satoshis, which was earned as a result of the payment.
786+
/// The total fee, in milli-satoshis, which was earned as a result of the payment.
787787
///
788788
/// Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
789789
/// was pending, the amount the next hop claimed will have been rounded down to the nearest
@@ -797,6 +797,18 @@ pub enum Event {
797797
/// `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
798798
/// `None`.
799799
fee_earned_msat: Option<u64>,
800+
/// The share of the total fee, in milli-satoshis, which was withheld in addition to the
801+
/// forwarding fee.
802+
///
803+
/// This will only be `Some` if we forwarded an intercepted HTLC with less than the
804+
/// expected amount. This means our counterparty accepted to receive less than the invoice
805+
/// amount, e.g., by claiming the payment featuring a corresponding
806+
/// [`PaymentClaimable::counterparty_skimmed_fee_msat`]
807+
///
808+
/// The caveat described above the `fee_earned_msat` field applies here as well.
809+
///
810+
/// [`PaymentClaimable::counterparty_skimmed_fee_msat`]: Self::PaymentClaimable::counterparty_skimmed_fee_msat
811+
skimmed_fee_msat: Option<u64>,
800812
/// If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
801813
/// transaction.
802814
claim_from_onchain_tx: bool,
@@ -1084,7 +1096,7 @@ impl Writeable for Event {
10841096
}
10851097
&Event::PaymentForwarded {
10861098
fee_earned_msat, prev_channel_id, claim_from_onchain_tx,
1087-
next_channel_id, outbound_amount_forwarded_msat
1099+
next_channel_id, outbound_amount_forwarded_msat, skimmed_fee_msat,
10881100
} => {
10891101
7u8.write(writer)?;
10901102
write_tlv_fields!(writer, {
@@ -1093,6 +1105,7 @@ impl Writeable for Event {
10931105
(2, claim_from_onchain_tx, required),
10941106
(3, next_channel_id, option),
10951107
(5, outbound_amount_forwarded_msat, option),
1108+
(7, skimmed_fee_msat, option),
10961109
});
10971110
},
10981111
&Event::ChannelClosed { ref channel_id, ref user_channel_id, ref reason,
@@ -1389,16 +1402,18 @@ impl MaybeReadable for Event {
13891402
let mut claim_from_onchain_tx = false;
13901403
let mut next_channel_id = None;
13911404
let mut outbound_amount_forwarded_msat = None;
1405+
let mut skimmed_fee_msat = None;
13921406
read_tlv_fields!(reader, {
13931407
(0, fee_earned_msat, option),
13941408
(1, prev_channel_id, option),
13951409
(2, claim_from_onchain_tx, required),
13961410
(3, next_channel_id, option),
13971411
(5, outbound_amount_forwarded_msat, option),
1412+
(7, skimmed_fee_msat, option),
13981413
});
13991414
Ok(Some(Event::PaymentForwarded {
14001415
fee_earned_msat, prev_channel_id, claim_from_onchain_tx, next_channel_id,
1401-
outbound_amount_forwarded_msat
1416+
outbound_amount_forwarded_msat, skimmed_fee_msat,
14021417
}))
14031418
};
14041419
f()

lightning/src/ln/chanmon_update_fail_tests.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ fn test_monitor_update_fail_reestablish() {
11071107
assert!(updates.update_fee.is_none());
11081108
assert_eq!(updates.update_fulfill_htlcs.len(), 1);
11091109
nodes[1].node.handle_update_fulfill_htlc(&nodes[2].node.get_our_node_id(), &updates.update_fulfill_htlcs[0]);
1110-
expect_payment_forwarded!(nodes[1], nodes[0], nodes[2], Some(1000), false, false);
1110+
expect_payment_forwarded!(nodes[1], nodes[0], nodes[2], Some(1000), None, false, false);
11111111
check_added_monitors!(nodes[1], 1);
11121112
assert!(nodes[1].node.get_and_clear_pending_msg_events().is_empty());
11131113
commitment_signed_dance!(nodes[1], nodes[2], updates.commitment_signed, false);
@@ -2153,7 +2153,7 @@ fn test_fail_htlc_on_broadcast_after_claim() {
21532153
nodes[1].node.handle_update_fulfill_htlc(&nodes[2].node.get_our_node_id(), &cs_updates.update_fulfill_htlcs[0]);
21542154
let bs_updates = get_htlc_update_msgs!(nodes[1], nodes[0].node.get_our_node_id());
21552155
check_added_monitors!(nodes[1], 1);
2156-
expect_payment_forwarded!(nodes[1], nodes[0], nodes[2], Some(1000), false, false);
2156+
expect_payment_forwarded!(nodes[1], nodes[0], nodes[2], Some(1000), None, false, false);
21572157

21582158
mine_transaction(&nodes[1], &bs_txn[0]);
21592159
check_closed_event!(nodes[1], 1, ClosureReason::CommitmentTxConfirmed, [nodes[2].node.get_our_node_id()], 100000);
@@ -2526,7 +2526,7 @@ fn do_test_reconnect_dup_htlc_claims(htlc_status: HTLCStatusAtDupClaim, second_f
25262526
assert_eq!(fulfill_msg, cs_updates.update_fulfill_htlcs[0]);
25272527
}
25282528
nodes[1].node.handle_update_fulfill_htlc(&nodes[2].node.get_our_node_id(), &fulfill_msg);
2529-
expect_payment_forwarded!(nodes[1], nodes[0], nodes[2], Some(1000), false, false);
2529+
expect_payment_forwarded!(nodes[1], nodes[0], nodes[2], Some(1000), None, false, false);
25302530
check_added_monitors!(nodes[1], 1);
25312531

25322532
let mut bs_updates = None;
@@ -3156,7 +3156,7 @@ fn do_test_inverted_mon_completion_order(with_latest_manager: bool, complete_bc_
31563156
nodes[0].node.handle_update_fulfill_htlc(&nodes[1].node.get_our_node_id(), &bs_updates.update_fulfill_htlcs[0]);
31573157
do_commitment_signed_dance(&nodes[0], &nodes[1], &bs_updates.commitment_signed, false, false);
31583158

3159-
expect_payment_forwarded!(nodes[1], &nodes[0], &nodes[2], Some(1_000), false, !with_latest_manager);
3159+
expect_payment_forwarded!(nodes[1], &nodes[0], &nodes[2], Some(1_000), None, false, !with_latest_manager);
31603160

31613161
// Finally, check that the payment was, ultimately, seen as sent by node A.
31623162
expect_payment_sent(&nodes[0], payment_preimage, None, true, true);
@@ -3287,7 +3287,7 @@ fn do_test_durable_preimages_on_closed_channel(close_chans_before_reload: bool,
32873287
} else {
32883288
// While we forwarded the payment a while ago, we don't want to process events too early or
32893289
// we'll run background tasks we wanted to test individually.
3290-
expect_payment_forwarded!(nodes[1], nodes[0], nodes[2], None, true, !close_only_a);
3290+
expect_payment_forwarded!(nodes[1], nodes[0], nodes[2], None, None, true, !close_only_a);
32913291
}
32923292

32933293
mine_transactions(&nodes[0], &[&as_closing_tx[0], bs_preimage_tx]);
@@ -3310,7 +3310,7 @@ fn do_test_durable_preimages_on_closed_channel(close_chans_before_reload: bool,
33103310
reconnect_nodes(reconnect_args);
33113311
let (outpoint, ab_update_id, _) = nodes[1].chain_monitor.latest_monitor_update_id.lock().unwrap().get(&chan_id_ab).unwrap().clone();
33123312
nodes[1].chain_monitor.chain_monitor.force_channel_monitor_updated(outpoint, ab_update_id);
3313-
expect_payment_forwarded!(nodes[1], nodes[0], nodes[2], Some(1000), true, false);
3313+
expect_payment_forwarded!(nodes[1], nodes[0], nodes[2], Some(1000), None, true, false);
33143314
if !close_chans_before_reload {
33153315
// Once we call `process_pending_events` the final `ChannelMonitor` for the B<->C
33163316
// channel will fly, removing the payment preimage from it.
@@ -3404,7 +3404,7 @@ fn do_test_reload_mon_update_completion_actions(close_during_reload: bool) {
34043404
let bc_update_id = nodes[1].chain_monitor.latest_monitor_update_id.lock().unwrap().get(&chan_id_bc).unwrap().2;
34053405
let mut events = nodes[1].node.get_and_clear_pending_events();
34063406
assert_eq!(events.len(), if close_during_reload { 2 } else { 1 });
3407-
expect_payment_forwarded(events.pop().unwrap(), &nodes[1], &nodes[0], &nodes[2], Some(1000), close_during_reload, false);
3407+
expect_payment_forwarded(events.pop().unwrap(), &nodes[1], &nodes[0], &nodes[2], Some(1000), None, close_during_reload, false);
34083408
if close_during_reload {
34093409
match events[0] {
34103410
Event::ChannelClosed { .. } => {},
@@ -3478,7 +3478,7 @@ fn do_test_glacial_peer_cant_hang(hold_chan_a: bool) {
34783478
reconnect_nodes(reconnect);
34793479

34803480
if !hold_chan_a {
3481-
expect_payment_forwarded!(nodes[1], nodes[0], nodes[2], Some(1000), false, false);
3481+
expect_payment_forwarded!(nodes[1], nodes[0], nodes[2], Some(1000), None, false, false);
34823482
send_payment(&nodes[0], &[&nodes[1], &nodes[2]], 100_000);
34833483
} else {
34843484
assert!(nodes[1].node.get_and_clear_pending_events().is_empty());

lightning/src/ln/channel.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3304,15 +3304,15 @@ impl<SP: Deref> Channel<SP> where
33043304
Err(ChannelError::Close("Remote tried to fulfill/fail an HTLC we couldn't find".to_owned()))
33053305
}
33063306

3307-
pub fn update_fulfill_htlc(&mut self, msg: &msgs::UpdateFulfillHTLC) -> Result<(HTLCSource, u64), ChannelError> {
3307+
pub fn update_fulfill_htlc(&mut self, msg: &msgs::UpdateFulfillHTLC) -> Result<(HTLCSource, u64, Option<u64>), ChannelError> {
33083308
if !matches!(self.context.channel_state, ChannelState::ChannelReady(_)) {
33093309
return Err(ChannelError::Close("Got fulfill HTLC message when channel was not in an operational state".to_owned()));
33103310
}
33113311
if self.context.channel_state.is_peer_disconnected() {
33123312
return Err(ChannelError::Close("Peer sent update_fulfill_htlc when we needed a channel_reestablish".to_owned()));
33133313
}
33143314

3315-
self.mark_outbound_htlc_removed(msg.htlc_id, Some(msg.payment_preimage), None).map(|htlc| (htlc.source.clone(), htlc.amount_msat))
3315+
self.mark_outbound_htlc_removed(msg.htlc_id, Some(msg.payment_preimage), None).map(|htlc| (htlc.source.clone(), htlc.amount_msat, htlc.skimmed_fee_msat))
33163316
}
33173317

33183318
pub fn update_fail_htlc(&mut self, msg: &msgs::UpdateFailHTLC, fail_reason: HTLCFailReason) -> Result<(), ChannelError> {

lightning/src/ln/channelmanager.rs

+14-6
Original file line numberDiff line numberDiff line change
@@ -5668,8 +5668,9 @@ where
56685668
}
56695669

56705670
fn claim_funds_internal(&self, source: HTLCSource, payment_preimage: PaymentPreimage,
5671-
forwarded_htlc_value_msat: Option<u64>, from_onchain: bool, startup_replay: bool,
5672-
next_channel_counterparty_node_id: Option<PublicKey>, next_channel_outpoint: OutPoint
5671+
forwarded_htlc_value_msat: Option<u64>, skimmed_fee_msat: Option<u64>, from_onchain: bool,
5672+
startup_replay: bool, next_channel_counterparty_node_id: Option<PublicKey>,
5673+
next_channel_outpoint: OutPoint
56735674
) {
56745675
match source {
56755676
HTLCSource::OutboundRoute { session_priv, payment_id, path, .. } => {
@@ -5767,13 +5768,16 @@ where
57675768
Some(claimed_htlc_value - forwarded_htlc_value)
57685769
} else { None }
57695770
} else { None };
5771+
debug_assert!(skimmed_fee_msat <= fee_earned_msat,
5772+
"skimmed_fee_msat must always be included in fee_earned_msat");
57705773
Some(MonitorUpdateCompletionAction::EmitEventAndFreeOtherChannel {
57715774
event: events::Event::PaymentForwarded {
57725775
fee_earned_msat,
57735776
claim_from_onchain_tx: from_onchain,
57745777
prev_channel_id: Some(prev_outpoint.to_channel_id()),
57755778
next_channel_id: Some(next_channel_outpoint.to_channel_id()),
57765779
outbound_amount_forwarded_msat: forwarded_htlc_value_msat,
5780+
skimmed_fee_msat,
57775781
},
57785782
downstream_counterparty_and_funding_outpoint: chan_to_release,
57795783
})
@@ -6712,7 +6716,7 @@ where
67126716

67136717
fn internal_update_fulfill_htlc(&self, counterparty_node_id: &PublicKey, msg: &msgs::UpdateFulfillHTLC) -> Result<(), MsgHandleErrInternal> {
67146718
let funding_txo;
6715-
let (htlc_source, forwarded_htlc_value) = {
6719+
let (htlc_source, forwarded_htlc_value, skimmed_fee_msat) = {
67166720
let per_peer_state = self.per_peer_state.read().unwrap();
67176721
let peer_state_mutex = per_peer_state.get(counterparty_node_id)
67186722
.ok_or_else(|| {
@@ -6750,7 +6754,11 @@ where
67506754
hash_map::Entry::Vacant(_) => return Err(MsgHandleErrInternal::send_err_msg_no_close(format!("Got a message for a channel from the wrong node! No such channel for the passed counterparty_node_id {}", counterparty_node_id), msg.channel_id))
67516755
}
67526756
};
6753-
self.claim_funds_internal(htlc_source, msg.payment_preimage.clone(), Some(forwarded_htlc_value), false, false, Some(*counterparty_node_id), funding_txo);
6757+
self.claim_funds_internal(htlc_source, msg.payment_preimage.clone(),
6758+
Some(forwarded_htlc_value), skimmed_fee_msat, false, false, Some(*counterparty_node_id),
6759+
funding_txo
6760+
);
6761+
67546762
Ok(())
67556763
}
67566764

@@ -7246,7 +7254,7 @@ where
72467254
let logger = WithContext::from(&self.logger, counterparty_node_id, Some(funding_outpoint.to_channel_id()));
72477255
if let Some(preimage) = htlc_update.payment_preimage {
72487256
log_trace!(logger, "Claiming HTLC with preimage {} from our monitor", preimage);
7249-
self.claim_funds_internal(htlc_update.source, preimage, htlc_update.htlc_value_satoshis.map(|v| v * 1000), true, false, counterparty_node_id, funding_outpoint);
7257+
self.claim_funds_internal(htlc_update.source, preimage, htlc_update.htlc_value_satoshis.map(|v| v * 1000), None, true, false, counterparty_node_id, funding_outpoint);
72507258
} else {
72517259
log_trace!(logger, "Failing HTLC with hash {} from our monitor", &htlc_update.payment_hash);
72527260
let receiver = HTLCDestination::NextHopChannel { node_id: counterparty_node_id, channel_id: funding_outpoint.to_channel_id() };
@@ -11119,7 +11127,7 @@ where
1111911127
// We use `downstream_closed` in place of `from_onchain` here just as a guess - we
1112011128
// don't remember in the `ChannelMonitor` where we got a preimage from, but if the
1112111129
// channel is closed we just assume that it probably came from an on-chain claim.
11122-
channel_manager.claim_funds_internal(source, preimage, Some(downstream_value),
11130+
channel_manager.claim_funds_internal(source, preimage, Some(downstream_value), None,
1112311131
downstream_closed, true, downstream_node_id, downstream_funding);
1112411132
}
1112511133

lightning/src/ln/functional_test_utils.rs

+18-6
Original file line numberDiff line numberDiff line change
@@ -2201,14 +2201,19 @@ macro_rules! expect_payment_path_successful {
22012201

22022202
pub fn expect_payment_forwarded<CM: AChannelManager, H: NodeHolder<CM=CM>>(
22032203
event: Event, node: &H, prev_node: &H, next_node: &H, expected_fee: Option<u64>,
2204-
upstream_force_closed: bool, downstream_force_closed: bool
2204+
expected_extra_fee_limit_msat: Option<u64>, upstream_force_closed: bool,
2205+
downstream_force_closed: bool
22052206
) {
22062207
match event {
22072208
Event::PaymentForwarded {
22082209
fee_earned_msat, prev_channel_id, claim_from_onchain_tx, next_channel_id,
2209-
outbound_amount_forwarded_msat: _
2210+
outbound_amount_forwarded_msat: _, skimmed_fee_msat
22102211
} => {
22112212
assert_eq!(fee_earned_msat, expected_fee);
2213+
2214+
// Check that the (knowingly) withheld amount is always less or equal to the expected
2215+
// overpaid amount.
2216+
assert!(skimmed_fee_msat <= expected_extra_fee_limit_msat);
22122217
if !upstream_force_closed {
22132218
// Is the event prev_channel_id in one of the channels between the two nodes?
22142219
assert!(node.node().list_channels().iter().any(|x| x.counterparty.node_id == prev_node.node().get_our_node_id() && x.channel_id == prev_channel_id.unwrap()));
@@ -2225,12 +2230,14 @@ pub fn expect_payment_forwarded<CM: AChannelManager, H: NodeHolder<CM=CM>>(
22252230
}
22262231

22272232
macro_rules! expect_payment_forwarded {
2228-
($node: expr, $prev_node: expr, $next_node: expr, $expected_fee: expr, $upstream_force_closed: expr, $downstream_force_closed: expr) => {
2233+
($node: expr, $prev_node: expr, $next_node: expr, $expected_fee: expr,
2234+
$expected_extra_fee_limit_msat: expr, $upstream_force_closed: expr,
2235+
$downstream_force_closed: expr) => {
22292236
let mut events = $node.node.get_and_clear_pending_events();
22302237
assert_eq!(events.len(), 1);
22312238
$crate::ln::functional_test_utils::expect_payment_forwarded(
22322239
events.pop().unwrap(), &$node, &$prev_node, &$next_node, $expected_fee,
2233-
$upstream_force_closed, $downstream_force_closed);
2240+
$expected_extra_fee_limit_msat, $upstream_force_closed, $downstream_force_closed);
22342241
}
22352242
}
22362243

@@ -2664,8 +2671,13 @@ pub fn pass_claimed_payment_along_route<'a, 'b, 'c>(origin_node: &Node<'a, 'b, '
26642671
channel.context().config().forwarding_fee_base_msat
26652672
}
26662673
};
2667-
if $idx == 1 { fee += expected_extra_fees[i]; }
2668-
expect_payment_forwarded!(*$node, $next_node, $prev_node, Some(fee as u64), false, false);
2674+
let mut expected_extra_fee_limit = None;
2675+
if $idx == 1 {
2676+
fee += expected_extra_fees[i];
2677+
expected_extra_fee_limit = Some(expected_extra_fees[i] as u64);
2678+
}
2679+
expect_payment_forwarded!(*$node, $next_node, $prev_node, Some(fee as u64),
2680+
expected_extra_fee_limit, false, false);
26692681
expected_total_fee_msat += fee as u64;
26702682
check_added_monitors!($node, 1);
26712683
let new_next_msgs = if $new_msgs {

lightning/src/ln/functional_tests.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -2889,7 +2889,7 @@ fn test_htlc_on_chain_success() {
28892889
}
28902890
let chan_id = Some(chan_1.2);
28912891
match forwarded_events[1] {
2892-
Event::PaymentForwarded { fee_earned_msat, prev_channel_id, claim_from_onchain_tx, next_channel_id, outbound_amount_forwarded_msat } => {
2892+
Event::PaymentForwarded { fee_earned_msat, prev_channel_id, claim_from_onchain_tx, next_channel_id, outbound_amount_forwarded_msat, .. } => {
28932893
assert_eq!(fee_earned_msat, Some(1000));
28942894
assert_eq!(prev_channel_id, chan_id);
28952895
assert_eq!(claim_from_onchain_tx, true);
@@ -2899,7 +2899,7 @@ fn test_htlc_on_chain_success() {
28992899
_ => panic!()
29002900
}
29012901
match forwarded_events[2] {
2902-
Event::PaymentForwarded { fee_earned_msat, prev_channel_id, claim_from_onchain_tx, next_channel_id, outbound_amount_forwarded_msat } => {
2902+
Event::PaymentForwarded { fee_earned_msat, prev_channel_id, claim_from_onchain_tx, next_channel_id, outbound_amount_forwarded_msat, .. } => {
29032903
assert_eq!(fee_earned_msat, Some(1000));
29042904
assert_eq!(prev_channel_id, chan_id);
29052905
assert_eq!(claim_from_onchain_tx, true);
@@ -4912,7 +4912,7 @@ fn test_onchain_to_onchain_claim() {
49124912
_ => panic!("Unexpected event"),
49134913
}
49144914
match events[1] {
4915-
Event::PaymentForwarded { fee_earned_msat, prev_channel_id, claim_from_onchain_tx, next_channel_id, outbound_amount_forwarded_msat } => {
4915+
Event::PaymentForwarded { fee_earned_msat, prev_channel_id, claim_from_onchain_tx, next_channel_id, outbound_amount_forwarded_msat, .. } => {
49164916
assert_eq!(fee_earned_msat, Some(1000));
49174917
assert_eq!(prev_channel_id, Some(chan_1.2));
49184918
assert_eq!(claim_from_onchain_tx, true);
@@ -5097,7 +5097,7 @@ fn test_duplicate_payment_hash_one_failure_one_success() {
50975097

50985098
// Solve 2nd HTLC by broadcasting on B's chain HTLC-Success Tx from C
50995099
mine_transaction(&nodes[1], &htlc_success_txn[1]);
5100-
expect_payment_forwarded!(nodes[1], nodes[0], nodes[2], Some(196), true, true);
5100+
expect_payment_forwarded!(nodes[1], nodes[0], nodes[2], Some(196), None, true, true);
51015101
let updates = get_htlc_update_msgs!(nodes[1], nodes[0].node.get_our_node_id());
51025102
assert!(updates.update_add_htlcs.is_empty());
51035103
assert!(updates.update_fail_htlcs.is_empty());
@@ -8819,7 +8819,7 @@ fn do_test_onchain_htlc_settlement_after_close(broadcast_alice: bool, go_onchain
88198819

88208820
nodes[1].node.handle_update_fulfill_htlc(&nodes[2].node.get_our_node_id(), &carol_updates.update_fulfill_htlcs[0]);
88218821
let went_onchain = go_onchain_before_fulfill || force_closing_node == 1;
8822-
expect_payment_forwarded!(nodes[1], nodes[0], nodes[2], if went_onchain { None } else { Some(1000) }, went_onchain, false);
8822+
expect_payment_forwarded!(nodes[1], nodes[0], nodes[2], if went_onchain { None } else { Some(1000) }, None, went_onchain, false);
88238823
// If Alice broadcasted but Bob doesn't know yet, here he prepares to tell her about the preimage.
88248824
if !go_onchain_before_fulfill && broadcast_alice {
88258825
let events = nodes[1].node.get_and_clear_pending_msg_events();

lightning/src/ln/payment_tests.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ fn do_retry_with_no_persist(confirm_before_reload: bool) {
737737
nodes[1].node.handle_update_fulfill_htlc(&nodes[2].node.get_our_node_id(), &htlc_fulfill_updates.update_fulfill_htlcs[0]);
738738
check_added_monitors!(nodes[1], 1);
739739
commitment_signed_dance!(nodes[1], nodes[2], htlc_fulfill_updates.commitment_signed, false);
740-
expect_payment_forwarded!(nodes[1], nodes[0], nodes[2], None, true, false);
740+
expect_payment_forwarded!(nodes[1], nodes[0], nodes[2], None, None, true, false);
741741

742742
if confirm_before_reload {
743743
let best_block = nodes[0].blocks.lock().unwrap().last().unwrap().clone();
@@ -3621,7 +3621,7 @@ fn do_claim_from_closed_chan(fail_payment: bool) {
36213621

36223622
mine_transactions(&nodes[1], &[&bs_tx[0], &ds_tx[0]]);
36233623
check_added_monitors(&nodes[1], 1);
3624-
expect_payment_forwarded!(nodes[1], nodes[0], nodes[3], Some(1000), false, true);
3624+
expect_payment_forwarded!(nodes[1], nodes[0], nodes[3], Some(1000), None, false, true);
36253625

36263626
let bs_claims = nodes[1].node.get_and_clear_pending_msg_events();
36273627
check_added_monitors(&nodes[1], 1);
@@ -3640,7 +3640,7 @@ fn do_claim_from_closed_chan(fail_payment: bool) {
36403640
let cs_claim_msgs = nodes[2].node.get_and_clear_pending_msg_events();
36413641
check_added_monitors(&nodes[2], 1);
36423642
commitment_signed_dance!(nodes[2], nodes[3], updates.commitment_signed, false, true);
3643-
expect_payment_forwarded!(nodes[2], nodes[0], nodes[3], Some(1000), false, false);
3643+
expect_payment_forwarded!(nodes[2], nodes[0], nodes[3], Some(1000), None, false, false);
36443644
cs_claim_msgs
36453645
} else { panic!(); };
36463646

0 commit comments

Comments
 (0)