- fn update_channel_intern(&self, msg: &msgs::UnsignedChannelUpdate, full_msg: Option<&msgs::ChannelUpdate>, sig: Option<&secp256k1::ecdsa::Signature>) -> Result<(), LightningError> {
+ /// For an already known (from announcement) channel, verify the given [`ChannelUpdate`].
+ ///
+ /// This checks whether the update currently is applicable by [`Self::update_channel`].
+ ///
+ /// If built with `no-std`, any updates with a timestamp more than two weeks in the past or
+ /// materially in the future will be rejected.
+ pub fn verify_channel_update(&self, msg: &msgs::ChannelUpdate) -> Result<(), LightningError> {
+ self.update_channel_internal(&msg.contents, Some(&msg), Some(&msg.signature), true)
+ }
+
+ fn update_channel_internal(&self, msg: &msgs::UnsignedChannelUpdate,
+ full_msg: Option<&msgs::ChannelUpdate>, sig: Option<&secp256k1::ecdsa::Signature>,
+ only_verify: bool) -> Result<(), LightningError>
+ {