@@ -684,6 +684,52 @@ 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+ /// The proposed total fee for the closing transaction.
722+ pub fee_satoshis : u64 ,
723+ /// The locktime of the closing transaction.
724+ pub locktime : u32 ,
725+ /// A signature on the closing transaction omitting the `closee` output.
726+ pub closer_output_only : Option < Signature > ,
727+ /// A signature on the closing transaction omitting the `closer` output.
728+ pub closee_output_only : Option < Signature > ,
729+ /// A signature on the closing transaction covering both `closer` and `closee` outputs.
730+ pub closer_and_closee_outputs : Option < Signature > ,
731+ }
732+
687733/// A [`start_batch`] message to be sent to group together multiple channel messages as a single
688734/// logical message.
689735///
@@ -1914,6 +1960,12 @@ pub trait ChannelMessageHandler: BaseMessageHandler {
19141960 fn handle_shutdown ( & self , their_node_id : PublicKey , msg : & Shutdown ) ;
19151961 /// Handle an incoming `closing_signed` message from the given peer.
19161962 fn handle_closing_signed ( & self , their_node_id : PublicKey , msg : & ClosingSigned ) ;
1963+ /// Handle an incoming `closing_complete` message from the given peer.
1964+ #[ cfg( simple_close) ]
1965+ fn handle_closing_complete ( & self , their_node_id : PublicKey , msg : ClosingComplete ) ;
1966+ /// Handle an incoming `closing_sig` message from the given peer.
1967+ #[ cfg( simple_close) ]
1968+ fn handle_closing_sig ( & self , their_node_id : PublicKey , msg : ClosingSig ) ;
19171969
19181970 // Quiescence
19191971 /// Handle an incoming `stfu` message from the given peer.
@@ -2744,6 +2796,24 @@ impl_writeable_msg!(ClosingSigned,
27442796 { ( 1 , fee_range, option) }
27452797) ;
27462798
2799+ impl_writeable_msg ! ( ClosingComplete ,
2800+ { channel_id, closer_scriptpubkey, closee_scriptpubkey, fee_satoshis, locktime } ,
2801+ {
2802+ ( 1 , closer_output_only, option) ,
2803+ ( 2 , closee_output_only, option) ,
2804+ ( 3 , closer_and_closee_outputs, option)
2805+ }
2806+ ) ;
2807+
2808+ impl_writeable_msg ! ( ClosingSig ,
2809+ { channel_id, closer_scriptpubkey, closee_scriptpubkey, fee_satoshis, locktime } ,
2810+ {
2811+ ( 1 , closer_output_only, option) ,
2812+ ( 2 , closee_output_only, option) ,
2813+ ( 3 , closer_and_closee_outputs, option)
2814+ }
2815+ ) ;
2816+
27472817impl_writeable ! ( ClosingSignedFeeRange , {
27482818 min_fee_satoshis,
27492819 max_fee_satoshis
0 commit comments