+ // `child_idx` is the only thing guaranteed to make each channel unique without a restart
+ // (though `user_channel_id` should help, depending on user behavior). If it manages to
+ // roll over, we may generate duplicate keys for two different channels, which could result
+ // in loss of funds. Because we only support 32-bit+ systems, assert that our `AtomicUsize`
+ // doesn't reach `u32::MAX`.
+ assert!(child_idx < core::u32::MAX as usize, "2^32 channels opened without restart");