Skip to content

Commit

Permalink
f small fixups, grammar, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlueMatt committed Sep 6, 2022
1 parent 26caf16 commit 118f418
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lightning/src/chain/channelmonitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2931,7 +2931,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
htlc_value_satoshis,
}));
self.htlcs_resolved_on_chain.push(IrrevocablyResolvedHTLC {
commitment_tx_output_idx: commitment_tx_output_idx, resolving_txid: Some(entry.txid),
commitment_tx_output_idx, resolving_txid: Some(entry.txid),
payment_preimage: None,
});
},
Expand Down
13 changes: 5 additions & 8 deletions lightning/src/ln/payment_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,12 +589,7 @@ fn do_test_completed_payment_not_retryable_on_reload(use_dust: bool) {

let mut nodes = create_network(3, &node_cfgs, &node_chanmgrs);

let (funding_tx, chan_id) = open_zero_conf_channel(&nodes[0], &nodes[1], None);
confirm_transaction(&nodes[0], &funding_tx);
confirm_transaction(&nodes[1], &funding_tx);
// Ignore the announcement_signatures messages
nodes[0].node.get_and_clear_pending_msg_events();
nodes[1].node.get_and_clear_pending_msg_events();
let (_, funding_tx, chan_id, ..) = create_announced_chan_between_nodes(&nodes, 0, 1, InitFeatures::known(), InitFeatures::known());
let chan_id_2 = create_announced_chan_between_nodes(&nodes, 1, 2, InitFeatures::known(), InitFeatures::known()).2;

// Serialize the ChannelManager prior to sending payments
Expand Down Expand Up @@ -731,7 +726,7 @@ fn do_test_completed_payment_not_retryable_on_reload(use_dust: bool) {
assert_eq!(nodes[0].node.list_usable_channels().len(), 1);

// If we attempt to retry prior to the HTLC-Timeout (or commitment transaction, for dust HTLCs)
// confirming, we will fail as its considered still-pending...
// confirming, we will fail as it's considered still-pending...
let (new_route, _, _, _) = get_route_and_payment_hash!(nodes[0], nodes[2], if use_dust { 1_000 } else { 1_000_000 });
assert!(nodes[0].node.retry_payment(&new_route, payment_id).is_err());
assert!(nodes[0].node.get_and_clear_pending_msg_events().is_empty());
Expand All @@ -756,7 +751,8 @@ fn do_test_completed_payment_not_retryable_on_reload(use_dust: bool) {
reload_node!(second_new_chain_monitor, second_nodes_0_deserialized, second_persister);
reconnect_nodes(&nodes[0], &nodes[1], (true, true), (0, 0), (0, 0), (0, 0), (0, 0), (0, 0), (false, false));

// Now resend the payment, delivering the HTLC through to nodes[1] XXX
// Now resend the payment, delivering the HTLC and actually claiming it this time. This ensures
// the payment is not (spuriously) listed as still pending.
assert!(nodes[0].node.retry_payment(&new_route, payment_id).is_ok());
check_added_monitors!(nodes[0], 1);
pass_along_route(&nodes[0], &[&[&nodes[1], &nodes[2]]], if use_dust { 1_000 } else { 1_000_000 }, payment_hash, payment_secret);
Expand All @@ -771,6 +767,7 @@ fn do_test_completed_payment_not_retryable_on_reload(use_dust: bool) {
get_monitor!(nodes[0], chan_id_3).write(&mut chan_1_monitor_serialized).unwrap();
nodes_0_serialized = nodes[0].node.encode();

// Ensure that after reload we cannot retry the payment.
reload_node!(third_new_chain_monitor, third_nodes_0_deserialized, third_persister);
reconnect_nodes(&nodes[0], &nodes[1], (false, false), (0, 0), (0, 0), (0, 0), (0, 0), (0, 0), (false, false));

Expand Down

0 comments on commit 118f418

Please sign in to comment.