- reason: ChannelManager::build_first_hop_failure_packet(&incoming_shared_secret, 0x1000|20, &self.get_channel_update(chan).unwrap().encode_with_len()[..]),
+ reason: if let Ok(update) = chan_update {
+ ChannelManager::build_first_hop_failure_packet(&incoming_shared_secret, 0x1000|20, &update.encode_with_len()[..])
+ } else {
+ // This can only happen if the channel isn't in the fully-funded
+ // state yet, implying our counterparty is trying to route payments
+ // over the channel back to themselves (cause no one else should
+ // know the short_id is a lightning channel yet). We should have no
+ // problem just calling this unknown_next_peer
+ ChannelManager::build_first_hop_failure_packet(&incoming_shared_secret, 0x4000|10, &[])
+ },