]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Add `ChannelError::close` constructor
authorMatt Corallo <git@bluematt.me>
Sun, 5 May 2024 23:10:39 +0000 (23:10 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 10 Jun 2024 15:12:02 +0000 (15:12 +0000)
lightning/src/ln/channel.rs

index 716eba7cf509e2ab79618a0aad0fb2ede36a458b..14ebc663f957e503f16dfa01eeaf9bc9da54e5b4 100644 (file)
@@ -733,6 +733,12 @@ impl fmt::Display for ChannelError {
        }
 }
 
+impl ChannelError {
+       pub(super) fn close(err: String) -> Self {
+               ChannelError::Close(err.clone())
+       }
+}
+
 pub(super) struct WithChannelContext<'a, L: Deref> where L::Target: Logger {
        pub logger: &'a L,
        pub peer_id: Option<PublicKey>,