@@ -684,6 +684,48 @@ pub struct ClosingSigned {
684684 pub fee_range : Option < ClosingSignedFeeRange > ,
685685}
686686
687+ /// A [`closing_complete`] message to be sent to or received from a peer.
688+ ///
689+ /// [`closing_complete`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-negotiation-closing_complete-and-closing_sig
690+ #[ derive( Clone , Debug , Hash , PartialEq , Eq ) ]
691+ pub struct ClosingComplete {
692+ /// The channel ID.
693+ pub channel_id : ChannelId ,
694+ /// The destination of the closer's funds on closing.
695+ pub closer_scriptpubkey : ScriptBuf ,
696+ /// The destination of the closee's funds on closing.
697+ pub closee_scriptpubkey : ScriptBuf ,
698+ /// The proposed total fee for the closing transaction.
699+ pub fee_satoshis : u64 ,
700+ /// The locktime of the closing transaction.
701+ pub locktime : u32 ,
702+ /// A signature on the closing transaction omitting the `closee` output.
703+ pub closer_output_only : Option < Signature > ,
704+ /// A signature on the closing transaction omitting the `closer` output.
705+ pub closee_output_only : Option < Signature > ,
706+ /// A signature on the closing transaction covering both `closer` and `closee` outputs.
707+ pub closer_and_closee_outputs : Option < Signature > ,
708+ }
709+
710+ /// A [`closing_sig`] message to be sent to or received from a peer.
711+ ///
712+ /// [`closing_sig`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-negotiation-closing_complete-and-closing_sig
713+ #[ derive( Clone , Debug , Hash , PartialEq , Eq ) ]
714+ pub struct ClosingSig {
715+ /// The channel ID.
716+ pub channel_id : ChannelId ,
717+ /// The destination of the closer's funds on closing.
718+ pub closer_scriptpubkey : ScriptBuf ,
719+ /// The destination of the closee's funds on closing.
720+ pub closee_scriptpubkey : ScriptBuf ,
721+ /// A signature on the closing transaction omitting the `closee` output.
722+ pub closer_output_only : Option < Signature > ,
723+ /// A signature on the closing transaction omitting the `closer` output.
724+ pub closee_output_only : Option < Signature > ,
725+ /// A signature on the closing transaction covering both `closer` and `closee` outputs.
726+ pub closer_and_closee_outputs : Option < Signature > ,
727+ }
728+
687729/// A [`start_batch`] message to be sent to group together multiple channel messages as a single
688730/// logical message.
689731///
@@ -1914,6 +1956,12 @@ pub trait ChannelMessageHandler: BaseMessageHandler {
19141956 fn handle_shutdown ( & self , their_node_id : PublicKey , msg : & Shutdown ) ;
19151957 /// Handle an incoming `closing_signed` message from the given peer.
19161958 fn handle_closing_signed ( & self , their_node_id : PublicKey , msg : & ClosingSigned ) ;
1959+ /// Handle an incoming `closing_complete` message from the given peer.
1960+ #[ cfg( simple_close) ]
1961+ fn handle_closing_complete ( & self , their_node_id : PublicKey , msg : ClosingComplete ) ;
1962+ /// Handle an incoming `closing_sig` message from the given peer.
1963+ #[ cfg( simple_close) ]
1964+ fn handle_closing_sig ( & self , their_node_id : PublicKey , msg : ClosingSig ) ;
19171965
19181966 // Quiescence
19191967 /// Handle an incoming `stfu` message from the given peer.
@@ -2744,6 +2792,24 @@ impl_writeable_msg!(ClosingSigned,
27442792 { ( 1 , fee_range, option) }
27452793) ;
27462794
2795+ impl_writeable_msg ! ( ClosingComplete ,
2796+ { channel_id, closer_scriptpubkey, closee_scriptpubkey, fee_satoshis, locktime } ,
2797+ {
2798+ ( 1 , closer_output_only, option) ,
2799+ ( 2 , closee_output_only, option) ,
2800+ ( 3 , closer_and_closee_outputs, option)
2801+ }
2802+ ) ;
2803+
2804+ impl_writeable_msg ! ( ClosingSig ,
2805+ { channel_id, closer_scriptpubkey, closee_scriptpubkey } ,
2806+ {
2807+ ( 1 , closer_output_only, option) ,
2808+ ( 2 , closee_output_only, option) ,
2809+ ( 3 , closer_and_closee_outputs, option)
2810+ }
2811+ ) ;
2812+
27472813impl_writeable ! ( ClosingSignedFeeRange , {
27482814 min_fee_satoshis,
27492815 max_fee_satoshis
0 commit comments