@@ -4503,6 +4503,13 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
4503
4503
Ok ( ( ) )
4504
4504
}
4505
4505
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
+
4506
4513
fn internal_accept_channel ( & self , counterparty_node_id : & PublicKey , their_features : InitFeatures , msg : & msgs:: AcceptChannel ) -> Result < ( ) , MsgHandleErrInternal > {
4507
4514
let ( value, output_script, user_id) = {
4508
4515
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
4529
4536
Ok ( ( ) )
4530
4537
}
4531
4538
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
+
4532
4546
fn internal_funding_created ( & self , counterparty_node_id : & PublicKey , msg : & msgs:: FundingCreated ) -> Result < ( ) , MsgHandleErrInternal > {
4533
4547
let ( ( funding_msg, monitor, mut channel_ready) , mut chan) = {
4534
4548
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
5158
5172
Ok ( ( ) )
5159
5173
}
5160
5174
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
+
5161
5229
/// Process pending events from the `chain::Watch`, returning whether any events were processed.
5162
5230
fn process_pending_monitor_events ( & self ) -> bool {
5163
5231
let mut failed_channels = Vec :: new ( ) ;
@@ -5964,11 +6032,21 @@ impl<M: Deref , T: Deref , K: Deref , F: Deref , L: Deref >
5964
6032
let _ = handle_error ! ( self , self . internal_open_channel( counterparty_node_id, their_features, msg) , * counterparty_node_id) ;
5965
6033
}
5966
6034
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
+
5967
6040
fn handle_accept_channel ( & self , counterparty_node_id : & PublicKey , their_features : InitFeatures , msg : & msgs:: AcceptChannel ) {
5968
6041
let _persistence_guard = PersistenceNotifierGuard :: notify_on_drop ( & self . total_consistency_lock , & self . persistence_notifier ) ;
5969
6042
let _ = handle_error ! ( self , self . internal_accept_channel( counterparty_node_id, their_features, msg) , * counterparty_node_id) ;
5970
6043
}
5971
6044
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
+
5972
6050
fn handle_funding_created ( & self , counterparty_node_id : & PublicKey , msg : & msgs:: FundingCreated ) {
5973
6051
let _persistence_guard = PersistenceNotifierGuard :: notify_on_drop ( & self . total_consistency_lock , & self . persistence_notifier ) ;
5974
6052
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 >
6076
6154
pending_msg_events. retain ( |msg| {
6077
6155
match msg {
6078
6156
& events:: MessageSendEvent :: SendAcceptChannel { ref node_id, .. } => node_id != counterparty_node_id,
6157
+ & events:: MessageSendEvent :: SendAcceptChannelV2 { ref node_id, .. } => node_id != counterparty_node_id,
6079
6158
& events:: MessageSendEvent :: SendOpenChannel { ref node_id, .. } => node_id != counterparty_node_id,
6159
+ & events:: MessageSendEvent :: SendOpenChannelV2 { ref node_id, .. } => node_id != counterparty_node_id,
6080
6160
& events:: MessageSendEvent :: SendFundingCreated { ref node_id, .. } => node_id != counterparty_node_id,
6081
6161
& events:: MessageSendEvent :: SendFundingSigned { ref node_id, .. } => node_id != counterparty_node_id,
6082
6162
& 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,
6083
6172
& events:: MessageSendEvent :: SendAnnouncementSignatures { ref node_id, .. } => node_id != counterparty_node_id,
6084
6173
& events:: MessageSendEvent :: UpdateHTLCs { ref node_id, .. } => node_id != counterparty_node_id,
6085
6174
& 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 >
6206
6295
fn provided_init_features ( & self , _their_init_features : & PublicKey ) -> InitFeatures {
6207
6296
provided_init_features ( )
6208
6297
}
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
+ }
6209
6343
}
6210
6344
6211
6345
/// Fetches the set of [`NodeFeatures`] flags which are provided by or required by
0 commit comments