+
+ // Now test that if a peer sends us a second funding_locked after the channel is operational we
+ // will use the new alias.
+ as_funding_locked.short_channel_id_alias = Some(0xdeadbeef);
+ nodes[2].node.handle_funding_locked(&nodes[1].node.get_our_node_id(), &as_funding_locked);
+ // Note that we always respond to a funding_locked with a channel_update. Not a lot of reason
+ // to bother updating that code, so just drop the message here.
+ get_event_msg!(nodes[2], MessageSendEvent::SendChannelUpdate, nodes[1].node.get_our_node_id());
+ let updated_channel_info = nodes[2].node.list_usable_channels();
+ assert_eq!(updated_channel_info.len(), 1);
+ assert_eq!(updated_channel_info[0].inbound_scid_alias.unwrap(), 0xdeadbeef);
+ // Note that because we never send a duplicate funding_locked we can't send a payment through
+ // the 0xdeadbeef SCID alias.