Skip to content

Commit

Permalink
Minor post-merge cleanup, actual merge
Browse files Browse the repository at this point in the history
  • Loading branch information
optout21 committed May 17, 2024
2 parents 0212c99 + 6b99234 commit 292f1e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 63 deletions.
62 changes: 2 additions & 60 deletions lightning/src/ln/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3941,68 +3941,10 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
Ok(msg)
}

/*
#[cfg(any(dual_funding, splicing))]
pub fn tx_add_input(&mut self, msg: &msgs::TxAddInput) -> Result<InteractiveTxMessageSend, msgs::TxAbort> {
match self.interactive_tx_constructor {
Some(ref mut tx_constructor) => tx_constructor.handle_tx_add_input(msg).map_err(
|reason| reason.into_tx_abort_msg(self.channel_id)),
None => Err(msgs::TxAbort {
channel_id: self.channel_id(),
data: "We do not have an interactive transaction negotiation in progress".to_string().into_bytes()
}),
}
}

#[cfg(any(dual_funding, splicing))]
pub fn tx_add_output(&mut self, msg: &msgs::TxAddOutput)-> Result<InteractiveTxMessageSend, msgs::TxAbort> {
match self.interactive_tx_constructor {
Some(ref mut tx_constructor) => tx_constructor.handle_tx_add_output(msg).map_err(
|reason| reason.into_tx_abort_msg(self.channel_id)),
None => Err(msgs::TxAbort {
channel_id: self.channel_id(),
data: "We do not have an interactive transaction negotiation in progress".to_string().into_bytes()
}),
}
}

#[cfg(any(dual_funding, splicing))]
pub fn tx_remove_input(&mut self, msg: &msgs::TxRemoveInput)-> Result<InteractiveTxMessageSend, msgs::TxAbort> {
match self.interactive_tx_constructor {
Some(ref mut tx_constructor) => tx_constructor.handle_tx_remove_input(msg).map_err(
|reason| reason.into_tx_abort_msg(self.channel_id)),
None => Err(msgs::TxAbort {
channel_id: self.channel_id(),
data: "We do not have an interactive transaction negotiation in progress".to_string().into_bytes()
}),
}
}

#[cfg(any(dual_funding, splicing))]
pub fn tx_remove_output(&mut self, msg: &msgs::TxRemoveOutput)-> Result<InteractiveTxMessageSend, msgs::TxAbort> {
match self.interactive_tx_constructor {
Some(ref mut tx_constructor) => tx_constructor.handle_tx_remove_output(msg).map_err(
|reason| reason.into_tx_abort_msg(self.channel_id)),
None => Err(msgs::TxAbort {
channel_id: self.channel_id(),
data: "We do not have an interactive transaction negotiation in progress".to_string().into_bytes()
}),
}
}

#[cfg(any(dual_funding, splicing))]
pub fn tx_complete(&mut self, msg: &msgs::TxComplete)
-> Result<HandleTxCompleteValue, msgs::TxAbort> {
match self.interactive_tx_constructor {
Some(ref mut tx_constructor) => tx_constructor.handle_tx_complete(msg).map_err(
|reason| reason.into_tx_abort_msg(self.channel_id)),
None => Err(msgs::TxAbort {
channel_id: self.channel_id(),
data: "We do not have an interactive transaction negotiation in progress".to_string().into_bytes()
}),
}
pub fn tx_signatures(&self, _msg: &msgs::TxSignatures)-> Result<InteractiveTxMessageSend, ChannelError> {
todo!();
}
}*/

#[cfg(any(dual_funding, splicing))]
pub fn tx_init_rbf(&self, _msg: &msgs::TxInitRbf)-> Result<InteractiveTxMessageSend, ChannelError> {
Expand Down
4 changes: 1 addition & 3 deletions lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11435,7 +11435,7 @@ where

// TODO(dual_funding): Combine this match arm with above once #[cfg(any(dual_funding, splicing))] is removed.
#[cfg(any(dual_funding, splicing))]
ChannelPhase::UnfundedInboundV2(_channel) => {
ChannelPhase::UnfundedInboundV2(_) => {
// Since unfunded inbound channel maps are cleared upon disconnecting a peer,
// they are not persisted and won't be recovered after a crash.
// Therefore, they shouldn't exist at this point.
Expand Down Expand Up @@ -15142,8 +15142,6 @@ mod tests {
nodes[0].node.contribute_funding_inputs(&channel_id, &counterparty_node_id, funding_inputs).unwrap();
} else { panic!(); }
*/
// nodes[0] will generate a TxAddInput message to kickstart the interactive transaction construction
// protocol with nodes[1].
let tx_add_input_msg = get_event_msg!(&nodes[0], MessageSendEvent::SendTxAddInput, nodes[1].node.get_our_node_id());

nodes[1].node.handle_tx_add_input(&nodes[0].node.get_our_node_id(), &tx_add_input_msg);
Expand Down

0 comments on commit 292f1e0

Please sign in to comment.