+ if simulate_broken_lnd {
+ // lnd has a long-standing bug where they send a funding_locked prior to a
+ // channel_reestablish if you reconnect prior to funding_locked time.
+ //
+ // Here we simulate that behavior, delivering a funding_locked immediately on
+ // reconnect. Note that we don't bother skipping the now-duplicate funding_locked sent
+ // in `reconnect_nodes` but we currently don't fail based on that.
+ //
+ // See-also <https://github.com/lightningnetwork/lnd/issues/4006>
+ nodes[1].node.handle_funding_locked(&nodes[0].node.get_our_node_id(), &as_funding_locked.as_ref().unwrap().0);
+ }