Skip to content

Commit d8f2725

Browse files
committed
Track the amount spent on fees as payments are retried
Especially once we merge the `InvoicePayer` logic soon, we'll want to expose the total fee paid in the `PaymentSent` event.
1 parent 2ed1ba6 commit d8f2725

7 files changed

+97
-42
lines changed

lightning/src/ln/chanmon_update_fail_tests.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ fn do_test_monitor_temporary_update_fail(disconnect_count: usize) {
304304
let events_3 = nodes[0].node.get_and_clear_pending_events();
305305
assert_eq!(events_3.len(), 1);
306306
match events_3[0] {
307-
Event::PaymentSent { ref payment_preimage, ref payment_hash } => {
307+
Event::PaymentSent { ref payment_preimage, ref payment_hash, .. } => {
308308
assert_eq!(*payment_preimage, payment_preimage_1);
309309
assert_eq!(*payment_hash, payment_hash_1);
310310
},
@@ -397,7 +397,7 @@ fn do_test_monitor_temporary_update_fail(disconnect_count: usize) {
397397
let events_3 = nodes[0].node.get_and_clear_pending_events();
398398
assert_eq!(events_3.len(), 1);
399399
match events_3[0] {
400-
Event::PaymentSent { ref payment_preimage, ref payment_hash } => {
400+
Event::PaymentSent { ref payment_preimage, ref payment_hash, .. } => {
401401
assert_eq!(*payment_preimage, payment_preimage_1);
402402
assert_eq!(*payment_hash, payment_hash_1);
403403
},
@@ -1399,7 +1399,7 @@ fn claim_while_disconnected_monitor_update_fail() {
13991399
let events = nodes[0].node.get_and_clear_pending_events();
14001400
assert_eq!(events.len(), 1);
14011401
match events[0] {
1402-
Event::PaymentSent { ref payment_preimage, ref payment_hash } => {
1402+
Event::PaymentSent { ref payment_preimage, ref payment_hash, .. } => {
14031403
assert_eq!(*payment_preimage, payment_preimage_1);
14041404
assert_eq!(*payment_hash, payment_hash_1);
14051405
},
@@ -1806,7 +1806,7 @@ fn monitor_update_claim_fail_no_response() {
18061806
let events = nodes[0].node.get_and_clear_pending_events();
18071807
assert_eq!(events.len(), 1);
18081808
match events[0] {
1809-
Event::PaymentSent { ref payment_preimage, ref payment_hash } => {
1809+
Event::PaymentSent { ref payment_preimage, ref payment_hash, .. } => {
18101810
assert_eq!(*payment_preimage, payment_preimage_1);
18111811
assert_eq!(*payment_hash, payment_hash_1);
18121812
},

lightning/src/ln/channelmanager.rs

+46-22
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,8 @@ pub(crate) enum PendingOutboundPayment {
436436
payment_hash: PaymentHash,
437437
payment_secret: Option<PaymentSecret>,
438438
pending_amt_msat: u64,
439+
/// Used to track the fee paid. Only present if the payment was serialized on 0.0.103+.
440+
pending_fee_msat: Option<u64>,
439441
/// The total payment amount across all paths, used to verify that a retry is not overpaying.
440442
total_msat: u64,
441443
/// Our best known block height at the time this payment was initiated.
@@ -462,6 +464,12 @@ impl PendingOutboundPayment {
462464
_ => false,
463465
}
464466
}
467+
fn get_total_fee_msat(&self) -> Option<u64> {
468+
match self {
469+
PendingOutboundPayment::Retryable { pending_fee_msat, .. } => pending_fee_msat.clone(),
470+
_ => None,
471+
}
472+
}
465473

466474
fn mark_fulfilled(&mut self) {
467475
let mut session_privs = HashSet::new();
@@ -475,7 +483,7 @@ impl PendingOutboundPayment {
475483
}
476484

477485
/// panics if part_amt_msat is None and !self.is_fulfilled
478-
fn remove(&mut self, session_priv: &[u8; 32], part_amt_msat: Option<u64>) -> bool {
486+
fn remove(&mut self, session_priv: &[u8; 32], part_amt_msat: Option<u64>, part_fee_msat: Option<u64>) -> bool {
479487
let remove_res = match self {
480488
PendingOutboundPayment::Legacy { session_privs } |
481489
PendingOutboundPayment::Retryable { session_privs, .. } |
@@ -484,14 +492,17 @@ impl PendingOutboundPayment {
484492
}
485493
};
486494
if remove_res {
487-
if let PendingOutboundPayment::Retryable { ref mut pending_amt_msat, .. } = self {
495+
if let PendingOutboundPayment::Retryable { ref mut pending_amt_msat, ref mut pending_fee_msat, .. } = self {
488496
*pending_amt_msat -= part_amt_msat.expect("We must only not provide an amount if the payment was already fulfilled");
497+
if let Some(fee_msat) = pending_fee_msat.as_mut() {
498+
*fee_msat -= part_fee_msat.expect("We must only not provide a fee if the payment was already fulfilled");
499+
}
489500
}
490501
}
491502
remove_res
492503
}
493504

494-
fn insert(&mut self, session_priv: [u8; 32], part_amt_msat: u64) -> bool {
505+
fn insert(&mut self, session_priv: [u8; 32], part_amt_msat: u64, part_fee_msat: u64) -> bool {
495506
let insert_res = match self {
496507
PendingOutboundPayment::Legacy { session_privs } |
497508
PendingOutboundPayment::Retryable { session_privs, .. } => {
@@ -500,8 +511,11 @@ impl PendingOutboundPayment {
500511
PendingOutboundPayment::Fulfilled { .. } => false
501512
};
502513
if insert_res {
503-
if let PendingOutboundPayment::Retryable { ref mut pending_amt_msat, .. } = self {
514+
if let PendingOutboundPayment::Retryable { ref mut pending_amt_msat, ref mut pending_fee_msat, .. } = self {
504515
*pending_amt_msat += part_amt_msat;
516+
if let Some(fee_msat) = pending_fee_msat.as_mut() {
517+
*fee_msat += part_fee_msat;
518+
}
505519
}
506520
}
507521
insert_res
@@ -2081,12 +2095,14 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
20812095
let payment = payment_entry.or_insert_with(|| PendingOutboundPayment::Retryable {
20822096
session_privs: HashSet::new(),
20832097
pending_amt_msat: 0,
2098+
pending_fee_msat: Some(0),
20842099
payment_hash: *payment_hash,
20852100
payment_secret: *payment_secret,
20862101
starting_block_height: self.best_block.read().unwrap().height(),
20872102
total_msat: total_value,
20882103
});
2089-
assert!(payment.insert(session_priv_bytes, path.last().unwrap().fee_msat));
2104+
assert!(payment.insert(session_priv_bytes, path.last().unwrap().fee_msat,
2105+
path.split_last().map(|(_, path_prefix)| path_prefix).unwrap_or(&[]).iter().map(|hop| hop.fee_msat).sum()));
20902106

20912107
send_res
20922108
} {
@@ -3108,7 +3124,8 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
31083124
let mut outbounds = self.pending_outbound_payments.lock().unwrap();
31093125
if let hash_map::Entry::Occupied(mut payment) = outbounds.entry(payment_id) {
31103126
let path_last_hop = path.last().expect("Outbound payments must have had a valid path");
3111-
if payment.get_mut().remove(&session_priv_bytes, Some(path_last_hop.fee_msat)) &&
3127+
if payment.get_mut().remove(&session_priv_bytes, Some(path_last_hop.fee_msat),
3128+
Some(path.split_last().map(|(_, path_prefix)| path_prefix).unwrap_or(&[]).iter().map(|hop| hop.fee_msat).sum())) &&
31123129
!payment.get().is_fulfilled()
31133130
{
31143131
let retry = if let Some(payee_data) = payee {
@@ -3165,7 +3182,9 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
31653182
let mut all_paths_failed = false;
31663183
let path_last_hop = path.last().expect("Outbound payments must have had a valid path");
31673184
if let hash_map::Entry::Occupied(mut payment) = outbounds.entry(payment_id) {
3168-
if !payment.get_mut().remove(&session_priv_bytes, Some(path_last_hop.fee_msat)) {
3185+
if !payment.get_mut().remove(&session_priv_bytes, Some(path_last_hop.fee_msat),
3186+
Some(path.split_last().map(|(_, path_prefix)| path_prefix).unwrap_or(&[]).iter().map(|hop| hop.fee_msat).sum()))
3187+
{
31693188
log_trace!(self.logger, "Received duplicative fail for HTLC with payment_hash {}", log_bytes!(payment_hash.0));
31703189
return;
31713190
}
@@ -3438,7 +3457,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
34383457
let mut outbounds = self.pending_outbound_payments.lock().unwrap();
34393458
if let hash_map::Entry::Occupied(mut payment) = outbounds.entry(payment_id) {
34403459
assert!(payment.get().is_fulfilled());
3441-
payment.get_mut().remove(&session_priv_bytes, None);
3460+
payment.get_mut().remove(&session_priv_bytes, None, None);
34423461
if payment.get().remaining_parts() == 0 {
34433462
payment.remove();
34443463
}
@@ -3454,8 +3473,9 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
34543473
let mut session_priv_bytes = [0; 32];
34553474
session_priv_bytes.copy_from_slice(&session_priv[..]);
34563475
let mut outbounds = self.pending_outbound_payments.lock().unwrap();
3457-
let found_payment = if let hash_map::Entry::Occupied(mut payment) = outbounds.entry(payment_id) {
3476+
if let hash_map::Entry::Occupied(mut payment) = outbounds.entry(payment_id) {
34583477
let found_payment = !payment.get().is_fulfilled();
3478+
let fee_paid_msat = payment.get().get_total_fee_msat();
34593479
payment.get_mut().mark_fulfilled();
34603480
if from_onchain {
34613481
// We currently immediately remove HTLCs which were fulfilled on-chain.
@@ -3464,21 +3484,22 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
34643484
// restart.
34653485
// TODO: We should have a second monitor event that informs us of payments
34663486
// irrevocably fulfilled.
3467-
payment.get_mut().remove(&session_priv_bytes, Some(path.last().unwrap().fee_msat));
3487+
payment.get_mut().remove(&session_priv_bytes, Some(path.last().unwrap().fee_msat),
3488+
Some(path.split_last().map(|(_, path_prefix)| path_prefix).unwrap_or(&[]).iter().map(|hop| hop.fee_msat).sum()));
34683489
if payment.get().remaining_parts() == 0 {
34693490
payment.remove();
34703491
}
34713492
}
3472-
found_payment
3473-
} else { false };
3474-
if found_payment {
3475-
let payment_hash = PaymentHash(Sha256::hash(&payment_preimage.0).into_inner());
3476-
self.pending_events.lock().unwrap().push(
3477-
events::Event::PaymentSent {
3478-
payment_preimage,
3479-
payment_hash: payment_hash
3480-
}
3481-
);
3493+
if found_payment {
3494+
let payment_hash = PaymentHash(Sha256::hash(&payment_preimage.0).into_inner());
3495+
self.pending_events.lock().unwrap().push(
3496+
events::Event::PaymentSent {
3497+
payment_preimage,
3498+
payment_hash: payment_hash,
3499+
fee_paid_msat,
3500+
}
3501+
);
3502+
}
34823503
} else {
34833504
log_trace!(self.logger, "Received duplicative fulfill for HTLC with payment_preimage {}", log_bytes!(payment_preimage.0));
34843505
}
@@ -5491,6 +5512,7 @@ impl_writeable_tlv_based_enum_upgradable!(PendingOutboundPayment,
54915512
},
54925513
(2, Retryable) => {
54935514
(0, session_privs, required),
5515+
(1, pending_fee_msat, option),
54945516
(2, payment_hash, required),
54955517
(4, payment_secret, option),
54965518
(6, total_msat, required),
@@ -5943,11 +5965,12 @@ impl<'a, Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>
59435965
return Err(DecodeError::InvalidValue);
59445966
}
59455967
let path_amt = path.last().unwrap().fee_msat;
5968+
let path_fee = path.split_last().map(|(_, path_prefix)| path_prefix).unwrap_or(&[]).iter().map(|hop| hop.fee_msat).sum();
59465969
let mut session_priv_bytes = [0; 32];
59475970
session_priv_bytes[..].copy_from_slice(&session_priv[..]);
59485971
match pending_outbound_payments.as_mut().unwrap().entry(payment_id) {
59495972
hash_map::Entry::Occupied(mut entry) => {
5950-
let newly_added = entry.get_mut().insert(session_priv_bytes, path_amt);
5973+
let newly_added = entry.get_mut().insert(session_priv_bytes, path_amt, path_fee);
59515974
log_info!(args.logger, "{} a pending payment path for {} msat for session priv {} on an existing pending payment with payment hash {}",
59525975
if newly_added { "Added" } else { "Had" }, path_amt, log_bytes!(session_priv_bytes), log_bytes!(htlc.payment_hash.0));
59535976
},
@@ -5957,6 +5980,7 @@ impl<'a, Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>
59575980
payment_hash: htlc.payment_hash,
59585981
payment_secret,
59595982
pending_amt_msat: path_amt,
5983+
pending_fee_msat: Some(path_fee),
59605984
total_msat: path_amt,
59615985
starting_block_height: best_block_height,
59625986
});
@@ -6256,7 +6280,7 @@ mod tests {
62566280
// further events will be generated for subsequence path successes.
62576281
let events = nodes[0].node.get_and_clear_pending_events();
62586282
match events[0] {
6259-
Event::PaymentSent { payment_preimage: ref preimage, payment_hash: ref hash } => {
6283+
Event::PaymentSent { payment_preimage: ref preimage, payment_hash: ref hash, .. } => {
62606284
assert_eq!(payment_preimage, *preimage);
62616285
assert_eq!(our_payment_hash, *hash);
62626286
},

lightning/src/ln/functional_test_utils.rs

+12-2
Original file line numberDiff line numberDiff line change
@@ -1081,13 +1081,20 @@ macro_rules! expect_payment_received {
10811081

10821082
macro_rules! expect_payment_sent {
10831083
($node: expr, $expected_payment_preimage: expr) => {
1084+
expect_payment_sent!($node, $expected_payment_preimage, None::<u64>);
1085+
};
1086+
($node: expr, $expected_payment_preimage: expr, $expected_fee_msat_opt: expr) => {
10841087
let events = $node.node.get_and_clear_pending_events();
10851088
let expected_payment_hash = PaymentHash(Sha256::hash(&$expected_payment_preimage.0).into_inner());
10861089
assert_eq!(events.len(), 1);
10871090
match events[0] {
1088-
Event::PaymentSent { ref payment_preimage, ref payment_hash } => {
1091+
Event::PaymentSent { ref payment_preimage, ref payment_hash, ref fee_paid_msat } => {
10891092
assert_eq!($expected_payment_preimage, *payment_preimage);
10901093
assert_eq!(expected_payment_hash, *payment_hash);
1094+
assert!(fee_paid_msat.is_some());
1095+
if $expected_fee_msat_opt.is_some() {
1096+
assert_eq!(*fee_paid_msat, $expected_fee_msat_opt);
1097+
}
10911098
},
10921099
_ => panic!("Unexpected event"),
10931100
}
@@ -1237,7 +1244,7 @@ pub fn send_along_route<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, route: Route
12371244
(our_payment_preimage, our_payment_hash, our_payment_secret, payment_id)
12381245
}
12391246

1240-
pub fn claim_payment_along_route<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, expected_paths: &[&[&Node<'a, 'b, 'c>]], skip_last: bool, our_payment_preimage: PaymentPreimage) {
1247+
pub fn do_claim_payment_along_route<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, expected_paths: &[&[&Node<'a, 'b, 'c>]], skip_last: bool, our_payment_preimage: PaymentPreimage) {
12411248
for path in expected_paths.iter() {
12421249
assert_eq!(path.last().unwrap().node.get_our_node_id(), expected_paths[0].last().unwrap().node.get_our_node_id());
12431250
}
@@ -1324,6 +1331,9 @@ pub fn claim_payment_along_route<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, exp
13241331
last_update_fulfill_dance!(origin_node, expected_route.first().unwrap());
13251332
}
13261333
}
1334+
}
1335+
pub fn claim_payment_along_route<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, expected_paths: &[&[&Node<'a, 'b, 'c>]], skip_last: bool, our_payment_preimage: PaymentPreimage) {
1336+
do_claim_payment_along_route(origin_node, expected_paths, skip_last, our_payment_preimage);
13271337
if !skip_last {
13281338
expect_payment_sent!(origin_node, our_payment_preimage);
13291339
}

lightning/src/ln/functional_tests.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -2659,7 +2659,7 @@ fn test_htlc_on_chain_success() {
26592659
let mut first_claimed = false;
26602660
for event in events {
26612661
match event {
2662-
Event::PaymentSent { payment_preimage, payment_hash } => {
2662+
Event::PaymentSent { payment_preimage, payment_hash, .. } => {
26632663
if payment_preimage == our_payment_preimage && payment_hash == payment_hash_1 {
26642664
assert!(!first_claimed);
26652665
first_claimed = true;
@@ -3350,7 +3350,7 @@ fn test_simple_peer_disconnect() {
33503350
let events = nodes[0].node.get_and_clear_pending_events();
33513351
assert_eq!(events.len(), 2);
33523352
match events[0] {
3353-
Event::PaymentSent { payment_preimage, payment_hash } => {
3353+
Event::PaymentSent { payment_preimage, payment_hash, .. } => {
33543354
assert_eq!(payment_preimage, payment_preimage_3);
33553355
assert_eq!(payment_hash, payment_hash_3);
33563356
},
@@ -3514,7 +3514,7 @@ fn do_test_drop_messages_peer_disconnect(messages_delivered: u8, simulate_broken
35143514
let events_4 = nodes[0].node.get_and_clear_pending_events();
35153515
assert_eq!(events_4.len(), 1);
35163516
match events_4[0] {
3517-
Event::PaymentSent { ref payment_preimage, ref payment_hash } => {
3517+
Event::PaymentSent { ref payment_preimage, ref payment_hash, .. } => {
35183518
assert_eq!(payment_preimage_1, *payment_preimage);
35193519
assert_eq!(payment_hash_1, *payment_hash);
35203520
},
@@ -3555,7 +3555,7 @@ fn do_test_drop_messages_peer_disconnect(messages_delivered: u8, simulate_broken
35553555
let events_4 = nodes[0].node.get_and_clear_pending_events();
35563556
assert_eq!(events_4.len(), 1);
35573557
match events_4[0] {
3558-
Event::PaymentSent { ref payment_preimage, ref payment_hash } => {
3558+
Event::PaymentSent { ref payment_preimage, ref payment_hash, .. } => {
35593559
assert_eq!(payment_preimage_1, *payment_preimage);
35603560
assert_eq!(payment_hash_1, *payment_hash);
35613561
},
@@ -3790,7 +3790,7 @@ fn test_drop_messages_peer_disconnect_dual_htlc() {
37903790
let events_3 = nodes[0].node.get_and_clear_pending_events();
37913791
assert_eq!(events_3.len(), 1);
37923792
match events_3[0] {
3793-
Event::PaymentSent { ref payment_preimage, ref payment_hash } => {
3793+
Event::PaymentSent { ref payment_preimage, ref payment_hash, .. } => {
37943794
assert_eq!(*payment_preimage, payment_preimage_1);
37953795
assert_eq!(*payment_hash, payment_hash_1);
37963796
},
@@ -5059,7 +5059,7 @@ fn test_duplicate_payment_hash_one_failure_one_success() {
50595059

50605060
let events = nodes[0].node.get_and_clear_pending_events();
50615061
match events[0] {
5062-
Event::PaymentSent { ref payment_preimage, ref payment_hash } => {
5062+
Event::PaymentSent { ref payment_preimage, ref payment_hash, .. } => {
50635063
assert_eq!(*payment_preimage, our_payment_preimage);
50645064
assert_eq!(*payment_hash, duplicate_payment_hash);
50655065
}
@@ -5572,7 +5572,7 @@ fn do_htlc_claim_local_commitment_only(use_dust: bool) {
55725572
let events = nodes[0].node.get_and_clear_pending_events();
55735573
assert_eq!(events.len(), 1);
55745574
match events[0] {
5575-
Event::PaymentSent { payment_preimage, payment_hash } => {
5575+
Event::PaymentSent { payment_preimage, payment_hash, .. } => {
55765576
assert_eq!(payment_preimage, our_payment_preimage);
55775577
assert_eq!(payment_hash, our_payment_hash);
55785578
},
@@ -6000,7 +6000,7 @@ fn test_free_and_fail_holding_cell_htlcs() {
60006000
let events = nodes[0].node.get_and_clear_pending_events();
60016001
assert_eq!(events.len(), 1);
60026002
match events[0] {
6003-
Event::PaymentSent { ref payment_preimage, ref payment_hash } => {
6003+
Event::PaymentSent { ref payment_preimage, ref payment_hash, .. } => {
60046004
assert_eq!(*payment_preimage, payment_preimage_1);
60056005
assert_eq!(*payment_hash, payment_hash_1);
60066006
}

lightning/src/ln/payment_tests.rs

+10-3
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ fn do_retry_with_no_persist(confirm_before_reload: bool) {
296296
let mut nodes = create_network(3, &node_cfgs, &node_chanmgrs);
297297

298298
let (_, _, chan_id, funding_tx) = create_announced_chan_between_nodes(&nodes, 0, 1, InitFeatures::known(), InitFeatures::known());
299-
create_announced_chan_between_nodes(&nodes, 1, 2, InitFeatures::known(), InitFeatures::known());
299+
let (_, _, chan_id_2, _) = create_announced_chan_between_nodes(&nodes, 1, 2, InitFeatures::known(), InitFeatures::known());
300300

301301
// Serialize the ChannelManager prior to sending payments
302302
let nodes_0_serialized = nodes[0].node.encode();
@@ -445,15 +445,22 @@ fn do_retry_with_no_persist(confirm_before_reload: bool) {
445445
// Finally, retry the payment (which was reloaded from the ChannelMonitor when nodes[0] was
446446
// reloaded) via a route over the new channel, which work without issue and eventually be
447447
// received and claimed at the recipient just like any other payment.
448-
let (new_route, _, _, _) = get_route_and_payment_hash!(nodes[0], nodes[2], 1_000_000);
448+
let (mut new_route, _, _, _) = get_route_and_payment_hash!(nodes[0], nodes[2], 1_000_000);
449+
450+
// Update the fee on the middle hop to ensure PaymentSent events have the correct (retried) fee
451+
// and not the original fee. We also update node[1]'s relevant config as
452+
// do_claim_payment_along_route expects us to never overpay.
453+
nodes[1].node.channel_state.lock().unwrap().by_id.get_mut(&chan_id_2).unwrap().config.forwarding_fee_base_msat += 100_000;
454+
new_route.paths[0][0].fee_msat += 100_000;
449455

450456
assert!(nodes[0].node.retry_payment(&new_route, payment_id_1).is_err()); // Shouldn't be allowed to retry a fulfilled payment
451457
nodes[0].node.retry_payment(&new_route, payment_id).unwrap();
452458
check_added_monitors!(nodes[0], 1);
453459
let mut events = nodes[0].node.get_and_clear_pending_msg_events();
454460
assert_eq!(events.len(), 1);
455461
pass_along_path(&nodes[0], &[&nodes[1], &nodes[2]], 1_000_000, payment_hash, Some(payment_secret), events.pop().unwrap(), true, None);
456-
claim_payment_along_route(&nodes[0], &[&[&nodes[1], &nodes[2]]], false, payment_preimage);
462+
do_claim_payment_along_route(&nodes[0], &[&[&nodes[1], &nodes[2]]], false, payment_preimage);
463+
expect_payment_sent!(nodes[0], payment_preimage, Some(new_route.paths[0][0].fee_msat));
457464
}
458465

459466
#[test]

0 commit comments

Comments
 (0)