@@ -1338,9 +1338,9 @@ fn test_duplicate_htlc_different_direction_onchain() {
1338
1338
for e in events {
1339
1339
match e {
1340
1340
MessageSendEvent::BroadcastChannelUpdate { .. } => {},
1341
- MessageSendEvent::HandleError { node_id, action: msgs::ErrorAction::SendErrorMessage { ref msg } } => {
1341
+ MessageSendEvent::HandleError { node_id, action: msgs::ErrorAction::DisconnectPeer { ref msg } } => {
1342
1342
assert_eq!(node_id, nodes[1].node.get_our_node_id());
1343
- assert_eq!(msg.data, "Channel closed because commitment or closing transaction was confirmed on chain.");
1343
+ assert_eq!(msg.as_ref().unwrap(). data, "Channel closed because commitment or closing transaction was confirmed on chain.");
1344
1344
},
1345
1345
MessageSendEvent::UpdateHTLCs { ref node_id, updates: msgs::CommitmentUpdate { ref update_add_htlcs, ref update_fulfill_htlcs, ref update_fail_htlcs, ref update_fail_malformed_htlcs, .. } } => {
1346
1346
assert!(update_add_htlcs.is_empty());
@@ -2369,7 +2369,7 @@ fn channel_monitor_network_test() {
2369
2369
_ => panic!("Unexpected event"),
2370
2370
};
2371
2371
match events[1] {
2372
- MessageSendEvent::HandleError { action: ErrorAction::SendErrorMessage { .. }, node_id } => {
2372
+ MessageSendEvent::HandleError { action: ErrorAction::DisconnectPeer { .. }, node_id } => {
2373
2373
assert_eq!(node_id, nodes[4].node.get_our_node_id());
2374
2374
},
2375
2375
_ => panic!("Unexpected event"),
@@ -2401,7 +2401,7 @@ fn channel_monitor_network_test() {
2401
2401
_ => panic!("Unexpected event"),
2402
2402
};
2403
2403
match events[1] {
2404
- MessageSendEvent::HandleError { action: ErrorAction::SendErrorMessage { .. }, node_id } => {
2404
+ MessageSendEvent::HandleError { action: ErrorAction::DisconnectPeer { .. }, node_id } => {
2405
2405
assert_eq!(node_id, nodes[3].node.get_our_node_id());
2406
2406
},
2407
2407
_ => panic!("Unexpected event"),
@@ -2913,7 +2913,7 @@ fn test_htlc_on_chain_success() {
2913
2913
let nodes_0_event = remove_first_msg_event_to_node(&nodes[0].node.get_our_node_id(), &mut events);
2914
2914
2915
2915
match nodes_2_event {
2916
- MessageSendEvent::HandleError { action: ErrorAction::SendErrorMessage { .. }, node_id: _ } => {},
2916
+ MessageSendEvent::HandleError { action: ErrorAction::DisconnectPeer { .. }, node_id: _ } => {},
2917
2917
_ => panic!("Unexpected event"),
2918
2918
}
2919
2919
@@ -3358,7 +3358,7 @@ fn do_test_commitment_revoked_fail_backward_exhaustive(deliver_bs_raa: bool, use
3358
3358
3359
3359
let nodes_2_event = remove_first_msg_event_to_node(&nodes[2].node.get_our_node_id(), &mut events);
3360
3360
match nodes_2_event {
3361
- MessageSendEvent::HandleError { action: ErrorAction::SendErrorMessage { msg: msgs::ErrorMessage { channel_id, ref data } }, node_id: _ } => {
3361
+ MessageSendEvent::HandleError { action: ErrorAction::DisconnectPeer { msg: Some( msgs::ErrorMessage { channel_id, ref data }) }, node_id: _ } => {
3362
3362
assert_eq!(channel_id, chan_2.2);
3363
3363
assert_eq!(data.as_str(), "Channel closed because commitment or closing transaction was confirmed on chain.");
3364
3364
},
@@ -4920,7 +4920,7 @@ fn test_onchain_to_onchain_claim() {
4920
4920
let nodes_0_event = remove_first_msg_event_to_node(&nodes[0].node.get_our_node_id(), &mut msg_events);
4921
4921
4922
4922
match nodes_2_event {
4923
- MessageSendEvent::HandleError { action: ErrorAction::SendErrorMessage { .. }, node_id: _ } => {},
4923
+ MessageSendEvent::HandleError { action: ErrorAction::DisconnectPeer { .. }, node_id: _ } => {},
4924
4924
_ => panic!("Unexpected event"),
4925
4925
}
4926
4926
@@ -7860,9 +7860,9 @@ fn test_channel_conf_timeout() {
7860
7860
let close_ev = nodes[1].node.get_and_clear_pending_msg_events();
7861
7861
assert_eq!(close_ev.len(), 1);
7862
7862
match close_ev[0] {
7863
- MessageSendEvent::HandleError { action: ErrorAction::SendErrorMessage { ref msg }, ref node_id } => {
7863
+ MessageSendEvent::HandleError { action: ErrorAction::DisconnectPeer { ref msg }, ref node_id } => {
7864
7864
assert_eq!(*node_id, nodes[0].node.get_our_node_id());
7865
- assert_eq!(msg.data, "Channel closed because funding transaction failed to confirm within 2016 blocks");
7865
+ assert_eq!(msg.as_ref().unwrap(). data, "Channel closed because funding transaction failed to confirm within 2016 blocks");
7866
7866
},
7867
7867
_ => panic!("Unexpected event"),
7868
7868
}
@@ -9212,8 +9212,8 @@ fn test_invalid_funding_tx() {
9212
9212
assert_eq!(events_2.len(), 1);
9213
9213
if let MessageSendEvent::HandleError { node_id, action } = &events_2[0] {
9214
9214
assert_eq!(*node_id, nodes[0].node.get_our_node_id());
9215
- if let msgs::ErrorAction::SendErrorMessage { msg } = action {
9216
- assert_eq!(msg.data, "Channel closed because of an exception: ".to_owned() + expected_err);
9215
+ if let msgs::ErrorAction::DisconnectPeer { msg } = action {
9216
+ assert_eq!(msg.as_ref().unwrap(). data, "Channel closed because of an exception: ".to_owned() + expected_err);
9217
9217
} else { panic!(); }
9218
9218
} else { panic!(); }
9219
9219
assert_eq!(nodes[1].node.list_channels().len(), 0);
@@ -10652,7 +10652,7 @@ fn do_test_funding_and_commitment_tx_confirm_same_block(confirm_remote_commitmen
10652
10652
let mut msg_events = closing_node.node.get_and_clear_pending_msg_events();
10653
10653
assert_eq!(msg_events.len(), 1);
10654
10654
match msg_events.pop().unwrap() {
10655
- MessageSendEvent::HandleError { action: msgs::ErrorAction::SendErrorMessage { .. }, .. } => {},
10655
+ MessageSendEvent::HandleError { action: msgs::ErrorAction::DisconnectPeer { .. }, .. } => {},
10656
10656
_ => panic!("Unexpected event"),
10657
10657
}
10658
10658
check_added_monitors(closing_node, 1);
0 commit comments