@@ -4503,6 +4503,13 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
45034503 Ok ( ( ) )
45044504 }
45054505
4506+ fn internal_open_channel_v2 ( & self , _counterparty_node_id : & PublicKey , _their_features : InitFeatures ,
4507+ msg : & msgs:: OpenChannelV2 ) -> Result < ( ) , MsgHandleErrInternal > {
4508+ // TODO - Actually implement
4509+ Err ( MsgHandleErrInternal :: send_err_msg_no_close ( "Dual-funded channels not supported" . to_owned ( ) ,
4510+ msg. temporary_channel_id . clone ( ) ) )
4511+ }
4512+
45064513 fn internal_accept_channel ( & self , counterparty_node_id : & PublicKey , their_features : InitFeatures , msg : & msgs:: AcceptChannel ) -> Result < ( ) , MsgHandleErrInternal > {
45074514 let ( value, output_script, user_id) = {
45084515 let mut channel_lock = self . channel_state . lock ( ) . unwrap ( ) ;
@@ -4529,6 +4536,13 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
45294536 Ok ( ( ) )
45304537 }
45314538
4539+ fn internal_accept_channel_v2 ( & self , _counterparty_node_id : & PublicKey , _their_features : InitFeatures ,
4540+ msg : & msgs:: AcceptChannelV2 ) -> Result < ( ) , MsgHandleErrInternal > {
4541+ // TODO - Actually implement
4542+ Err ( MsgHandleErrInternal :: send_err_msg_no_close ( "Dual-funded channels not supported" . to_owned ( ) ,
4543+ msg. temporary_channel_id . clone ( ) ) )
4544+ }
4545+
45324546 fn internal_funding_created ( & self , counterparty_node_id : & PublicKey , msg : & msgs:: FundingCreated ) -> Result < ( ) , MsgHandleErrInternal > {
45334547 let ( ( funding_msg, monitor, mut channel_ready) , mut chan) = {
45344548 let best_block = * self . best_block . read ( ) . unwrap ( ) ;
@@ -5158,6 +5172,60 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
51585172 Ok ( ( ) )
51595173 }
51605174
5175+ fn internal_tx_add_input ( & self , _counterparty_node_id : & PublicKey , msg : & msgs:: TxAddInput ) -> Result < ( ) , MsgHandleErrInternal > {
5176+ // TODO - Actually implement
5177+ Err ( MsgHandleErrInternal :: send_err_msg_no_close ( "Interactive transaction construction not supported" . to_owned ( ) ,
5178+ msg. channel_id . clone ( ) ) )
5179+ }
5180+
5181+ fn internal_tx_add_output ( & self , _counterparty_node_id : & PublicKey , msg : & msgs:: TxAddOutput ) -> Result < ( ) , MsgHandleErrInternal > {
5182+ // TODO - Actually implement
5183+ Err ( MsgHandleErrInternal :: send_err_msg_no_close ( "Interactive transaction construction not supported" . to_owned ( ) ,
5184+ msg. channel_id . clone ( ) ) )
5185+ }
5186+
5187+ fn internal_tx_remove_input ( & self , _counterparty_node_id : & PublicKey , msg : & msgs:: TxRemoveInput ) -> Result < ( ) , MsgHandleErrInternal > {
5188+ // TODO - Actually implement
5189+ Err ( MsgHandleErrInternal :: send_err_msg_no_close ( "Interactive transaction construction not supported" . to_owned ( ) ,
5190+ msg. channel_id . clone ( ) ) )
5191+ }
5192+
5193+ fn internal_tx_remove_output ( & self , _counterparty_node_id : & PublicKey , msg : & msgs:: TxRemoveOutput ) -> Result < ( ) , MsgHandleErrInternal > {
5194+ // TODO - Actually implement
5195+ Err ( MsgHandleErrInternal :: send_err_msg_no_close ( "Interactive transaction construction not supported" . to_owned ( ) ,
5196+ msg. channel_id . clone ( ) ) )
5197+ }
5198+
5199+ fn internal_tx_complete ( & self , _counterparty_node_id : & PublicKey , msg : & msgs:: TxComplete ) -> Result < ( ) , MsgHandleErrInternal > {
5200+ // TODO - Actually implement
5201+ Err ( MsgHandleErrInternal :: send_err_msg_no_close ( "Interactive transaction construction not supported" . to_owned ( ) ,
5202+ msg. channel_id . clone ( ) ) )
5203+ }
5204+
5205+ fn internal_tx_signatures ( & self , _counterparty_node_id : & PublicKey , msg : & msgs:: TxSignatures ) -> Result < ( ) , MsgHandleErrInternal > {
5206+ // TODO - Actually implement
5207+ Err ( MsgHandleErrInternal :: send_err_msg_no_close ( "Interactive transaction construction not supported" . to_owned ( ) ,
5208+ msg. channel_id . clone ( ) ) )
5209+ }
5210+
5211+ fn internal_tx_init_rbf ( & self , _counterparty_node_id : & PublicKey , msg : & msgs:: TxInitRbf ) -> Result < ( ) , MsgHandleErrInternal > {
5212+ // TODO - Actually implement
5213+ Err ( MsgHandleErrInternal :: send_err_msg_no_close ( "Interactive transaction construction not supported" . to_owned ( ) ,
5214+ msg. channel_id . clone ( ) ) )
5215+ }
5216+
5217+ fn internal_tx_ack_rbf ( & self , _counterparty_node_id : & PublicKey , msg : & msgs:: TxAckRbf ) -> Result < ( ) , MsgHandleErrInternal > {
5218+ // TODO - Actually implement
5219+ Err ( MsgHandleErrInternal :: send_err_msg_no_close ( "Interactive transaction construction not supported" . to_owned ( ) ,
5220+ msg. channel_id . clone ( ) ) )
5221+ }
5222+
5223+ fn internal_tx_abort ( & self , _counterparty_node_id : & PublicKey , msg : & msgs:: TxAbort ) -> Result < ( ) , MsgHandleErrInternal > {
5224+ // TODO - Actually implement
5225+ Err ( MsgHandleErrInternal :: send_err_msg_no_close ( "Interactive transaction construction not supported" . to_owned ( ) ,
5226+ msg. channel_id . clone ( ) ) )
5227+ }
5228+
51615229 /// Process pending events from the `chain::Watch`, returning whether any events were processed.
51625230 fn process_pending_monitor_events ( & self ) -> bool {
51635231 let mut failed_channels = Vec :: new ( ) ;
@@ -5964,11 +6032,21 @@ impl<M: Deref , T: Deref , K: Deref , F: Deref , L: Deref >
59646032 let _ = handle_error ! ( self , self . internal_open_channel( counterparty_node_id, their_features, msg) , * counterparty_node_id) ;
59656033 }
59666034
6035+ fn handle_open_channel_v2 ( & self , counterparty_node_id : & PublicKey , their_features : InitFeatures , msg : & msgs:: OpenChannelV2 ) {
6036+ let _persistence_guard = PersistenceNotifierGuard :: notify_on_drop ( & self . total_consistency_lock , & self . persistence_notifier ) ;
6037+ let _ = handle_error ! ( self , self . internal_open_channel_v2( counterparty_node_id, their_features, msg) , * counterparty_node_id) ;
6038+ }
6039+
59676040 fn handle_accept_channel ( & self , counterparty_node_id : & PublicKey , their_features : InitFeatures , msg : & msgs:: AcceptChannel ) {
59686041 let _persistence_guard = PersistenceNotifierGuard :: notify_on_drop ( & self . total_consistency_lock , & self . persistence_notifier ) ;
59696042 let _ = handle_error ! ( self , self . internal_accept_channel( counterparty_node_id, their_features, msg) , * counterparty_node_id) ;
59706043 }
59716044
6045+ fn handle_accept_channel_v2 ( & self , counterparty_node_id : & PublicKey , their_features : InitFeatures , msg : & msgs:: AcceptChannelV2 ) {
6046+ let _persistence_guard = PersistenceNotifierGuard :: notify_on_drop ( & self . total_consistency_lock , & self . persistence_notifier ) ;
6047+ let _ = handle_error ! ( self , self . internal_accept_channel_v2( counterparty_node_id, their_features, msg) , * counterparty_node_id) ;
6048+ }
6049+
59726050 fn handle_funding_created ( & self , counterparty_node_id : & PublicKey , msg : & msgs:: FundingCreated ) {
59736051 let _persistence_guard = PersistenceNotifierGuard :: notify_on_drop ( & self . total_consistency_lock , & self . persistence_notifier ) ;
59746052 let _ = handle_error ! ( self , self . internal_funding_created( counterparty_node_id, msg) , * counterparty_node_id) ;
@@ -6076,10 +6154,21 @@ impl<M: Deref , T: Deref , K: Deref , F: Deref , L: Deref >
60766154 pending_msg_events. retain ( |msg| {
60776155 match msg {
60786156 & events:: MessageSendEvent :: SendAcceptChannel { ref node_id, .. } => node_id != counterparty_node_id,
6157+ & events:: MessageSendEvent :: SendAcceptChannelV2 { ref node_id, .. } => node_id != counterparty_node_id,
60796158 & events:: MessageSendEvent :: SendOpenChannel { ref node_id, .. } => node_id != counterparty_node_id,
6159+ & events:: MessageSendEvent :: SendOpenChannelV2 { ref node_id, .. } => node_id != counterparty_node_id,
60806160 & events:: MessageSendEvent :: SendFundingCreated { ref node_id, .. } => node_id != counterparty_node_id,
60816161 & events:: MessageSendEvent :: SendFundingSigned { ref node_id, .. } => node_id != counterparty_node_id,
60826162 & events:: MessageSendEvent :: SendChannelReady { ref node_id, .. } => node_id != counterparty_node_id,
6163+ & events:: MessageSendEvent :: SendTxAddInput { ref node_id, .. } => node_id != counterparty_node_id,
6164+ & events:: MessageSendEvent :: SendTxAddOutput { ref node_id, .. } => node_id != counterparty_node_id,
6165+ & events:: MessageSendEvent :: SendTxRemoveInput { ref node_id, .. } => node_id != counterparty_node_id,
6166+ & events:: MessageSendEvent :: SendTxRemoveOutput { ref node_id, .. } => node_id != counterparty_node_id,
6167+ & events:: MessageSendEvent :: SendTxComplete { ref node_id, .. } => node_id != counterparty_node_id,
6168+ & events:: MessageSendEvent :: SendTxSignatures { ref node_id, .. } => node_id != counterparty_node_id,
6169+ & events:: MessageSendEvent :: SendTxInitRbf { ref node_id, .. } => node_id != counterparty_node_id,
6170+ & events:: MessageSendEvent :: SendTxAckRbf { ref node_id, .. } => node_id != counterparty_node_id,
6171+ & events:: MessageSendEvent :: SendTxAbort { ref node_id, .. } => node_id != counterparty_node_id,
60836172 & events:: MessageSendEvent :: SendAnnouncementSignatures { ref node_id, .. } => node_id != counterparty_node_id,
60846173 & events:: MessageSendEvent :: UpdateHTLCs { ref node_id, .. } => node_id != counterparty_node_id,
60856174 & events:: MessageSendEvent :: SendRevokeAndACK { ref node_id, .. } => node_id != counterparty_node_id,
@@ -6206,6 +6295,51 @@ impl<M: Deref , T: Deref , K: Deref , F: Deref , L: Deref >
62066295 fn provided_init_features ( & self , _their_init_features : & PublicKey ) -> InitFeatures {
62076296 provided_init_features ( )
62086297 }
6298+
6299+ fn handle_tx_add_input ( & self , counterparty_node_id : & PublicKey , msg : & msgs:: TxAddInput ) {
6300+ let _persistence_guard = PersistenceNotifierGuard :: notify_on_drop ( & self . total_consistency_lock , & self . persistence_notifier ) ;
6301+ let _ = handle_error ! ( self , self . internal_tx_add_input( counterparty_node_id, msg) , * counterparty_node_id) ;
6302+ }
6303+
6304+ fn handle_tx_add_output ( & self , counterparty_node_id : & PublicKey , msg : & msgs:: TxAddOutput ) {
6305+ let _persistence_guard = PersistenceNotifierGuard :: notify_on_drop ( & self . total_consistency_lock , & self . persistence_notifier ) ;
6306+ let _ = handle_error ! ( self , self . internal_tx_add_output( counterparty_node_id, msg) , * counterparty_node_id) ;
6307+ }
6308+
6309+ fn handle_tx_remove_input ( & self , counterparty_node_id : & PublicKey , msg : & msgs:: TxRemoveInput ) {
6310+ let _persistence_guard = PersistenceNotifierGuard :: notify_on_drop ( & self . total_consistency_lock , & self . persistence_notifier ) ;
6311+ let _ = handle_error ! ( self , self . internal_tx_remove_input( counterparty_node_id, msg) , * counterparty_node_id) ;
6312+ }
6313+
6314+ fn handle_tx_remove_output ( & self , counterparty_node_id : & PublicKey , msg : & msgs:: TxRemoveOutput ) {
6315+ let _persistence_guard = PersistenceNotifierGuard :: notify_on_drop ( & self . total_consistency_lock , & self . persistence_notifier ) ;
6316+ let _ = handle_error ! ( self , self . internal_tx_remove_output( counterparty_node_id, msg) , * counterparty_node_id) ;
6317+ }
6318+
6319+ fn handle_tx_complete ( & self , counterparty_node_id : & PublicKey , msg : & msgs:: TxComplete ) {
6320+ let _persistence_guard = PersistenceNotifierGuard :: notify_on_drop ( & self . total_consistency_lock , & self . persistence_notifier ) ;
6321+ let _ = handle_error ! ( self , self . internal_tx_complete( counterparty_node_id, msg) , * counterparty_node_id) ;
6322+ }
6323+
6324+ fn handle_tx_signatures ( & self , counterparty_node_id : & PublicKey , msg : & msgs:: TxSignatures ) {
6325+ let _persistence_guard = PersistenceNotifierGuard :: notify_on_drop ( & self . total_consistency_lock , & self . persistence_notifier ) ;
6326+ let _ = handle_error ! ( self , self . internal_tx_signatures( counterparty_node_id, msg) , * counterparty_node_id) ;
6327+ }
6328+
6329+ fn handle_tx_init_rbf ( & self , counterparty_node_id : & PublicKey , msg : & msgs:: TxInitRbf ) {
6330+ let _persistence_guard = PersistenceNotifierGuard :: notify_on_drop ( & self . total_consistency_lock , & self . persistence_notifier ) ;
6331+ let _ = handle_error ! ( self , self . internal_tx_init_rbf( counterparty_node_id, msg) , * counterparty_node_id) ;
6332+ }
6333+
6334+ fn handle_tx_ack_rbf ( & self , counterparty_node_id : & PublicKey , msg : & msgs:: TxAckRbf ) {
6335+ let _persistence_guard = PersistenceNotifierGuard :: notify_on_drop ( & self . total_consistency_lock , & self . persistence_notifier ) ;
6336+ let _ = handle_error ! ( self , self . internal_tx_ack_rbf( counterparty_node_id, msg) , * counterparty_node_id) ;
6337+ }
6338+
6339+ fn handle_tx_abort ( & self , counterparty_node_id : & PublicKey , msg : & msgs:: TxAbort ) {
6340+ let _persistence_guard = PersistenceNotifierGuard :: notify_on_drop ( & self . total_consistency_lock , & self . persistence_notifier ) ;
6341+ let _ = handle_error ! ( self , self . internal_tx_abort( counterparty_node_id, msg) , * counterparty_node_id) ;
6342+ }
62096343}
62106344
62116345/// Fetches the set of [`NodeFeatures`] flags which are provided by or required by
0 commit comments