Skip to content

Commit

Permalink
reintroduce the force close channel check in the tests
Browse files Browse the repository at this point in the history
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
  • Loading branch information
vincenzopalazzo committed Apr 22, 2022
1 parent 1f280a6 commit 5ada132
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lightning/src/ln/functional_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7395,8 +7395,15 @@ fn test_data_loss_protect() {
}
}

// Clear the event received by the node A, the failure need to be handled by the API user.
assert!(!nodes[0].node.get_and_clear_pending_events().is_empty());
// Check A is able to claim to_remote output
let mut node_txn = nodes[1].tx_broadcaster.txn_broadcasted.lock().unwrap().clone();
// The node B should not broadcast the transaction to force close the channel!
assert!(node_txn.is_empty());
// B should now detect that there is something wrong and should force close the channel.
// FIXME: we sent the warning message when the peer is behind to give the possibility to restore try to fix the problem
// but the spec is unclear on what we should do in the case of a warning message. For now we force close the channel anyway.
let exp_err = "We have fallen behind - we have received proof that if we broadcast remote is going to claim our funds - we can\'t do any automated broadcasting";
check_closed_event!(nodes[0], 1, ClosureReason::ProcessingError { err: exp_err.to_string() });
}

#[test]
Expand Down

0 comments on commit 5ada132

Please sign in to comment.