Skip to content

Commit bf8302f

Browse files
committed
f remove 'let _ =' for state transitions
1 parent 6cf638a commit bf8302f

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lightning/src/ln/interactivetxs.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ macro_rules! define_state_transitions {
461461
impl<S: LocalState> StateTransition<ReceivedChange, $data> for S {
462462
fn transition(self, data: $data) -> StateTransitionResult<ReceivedChange> {
463463
let mut context = self.into_negotiation_context();
464-
let _ = context.$transition(data)?;
464+
context.$transition(data)?;
465465
Ok(ReceivedChange(context))
466466
}
467467
}
@@ -472,7 +472,7 @@ macro_rules! define_state_transitions {
472472
impl<S: RemoteState> StateTransition<SentChange, $data> for S {
473473
fn transition(self, data: $data) -> StateTransitionResult<SentChange> {
474474
let mut context = self.into_negotiation_context();
475-
let _ = context.$transition(data);
475+
context.$transition(data);
476476
Ok(SentChange(context))
477477
}
478478
}
@@ -711,7 +711,7 @@ impl InteractiveTxConstructor {
711711
prevtx_out: input.previous_output.vout,
712712
sequence: input.sequence.to_consensus_u32(),
713713
};
714-
let _ = do_state_transition!(self, sent_tx_add_input, &msg)?;
714+
do_state_transition!(self, sent_tx_add_input, &msg)?;
715715
Ok(InteractiveTxMessageSend::TxAddInput(msg))
716716
} else if let Some((serial_id, output)) = self.outputs_to_contribute.pop() {
717717
let msg = msgs::TxAddOutput {
@@ -720,47 +720,47 @@ impl InteractiveTxConstructor {
720720
sats: output.value,
721721
script: output.script_pubkey,
722722
};
723-
let _ = do_state_transition!(self, sent_tx_add_output, &msg)?;
723+
do_state_transition!(self, sent_tx_add_output, &msg)?;
724724
Ok(InteractiveTxMessageSend::TxAddOutput(msg))
725725
} else {
726726
let msg = msgs::TxComplete { channel_id: self.channel_id };
727-
let _ = do_state_transition!(self, sent_tx_complete, &msg)?;
727+
do_state_transition!(self, sent_tx_complete, &msg)?;
728728
Ok(InteractiveTxMessageSend::TxComplete(msg))
729729
}
730730
}
731731

732732
pub fn handle_tx_add_input(
733733
&mut self, msg: &msgs::TxAddInput,
734734
) -> Result<InteractiveTxMessageSend, AbortReason> {
735-
let _ = do_state_transition!(self, received_tx_add_input, msg)?;
735+
do_state_transition!(self, received_tx_add_input, msg)?;
736736
self.do_local_state_transition()
737737
}
738738

739739
pub fn handle_tx_remove_input(
740740
&mut self, msg: &msgs::TxRemoveInput,
741741
) -> Result<InteractiveTxMessageSend, AbortReason> {
742-
let _ = do_state_transition!(self, received_tx_remove_input, msg)?;
742+
do_state_transition!(self, received_tx_remove_input, msg)?;
743743
self.do_local_state_transition()
744744
}
745745

746746
pub fn handle_tx_add_output(
747747
&mut self, msg: &msgs::TxAddOutput,
748748
) -> Result<InteractiveTxMessageSend, AbortReason> {
749-
let _ = do_state_transition!(self, received_tx_add_output, msg)?;
749+
do_state_transition!(self, received_tx_add_output, msg)?;
750750
self.do_local_state_transition()
751751
}
752752

753753
pub fn handle_tx_remove_output(
754754
&mut self, msg: &msgs::TxRemoveOutput,
755755
) -> Result<InteractiveTxMessageSend, AbortReason> {
756-
let _ = do_state_transition!(self, received_tx_remove_output, msg)?;
756+
do_state_transition!(self, received_tx_remove_output, msg)?;
757757
self.do_local_state_transition()
758758
}
759759

760760
pub fn handle_tx_complete(
761761
&mut self, msg: &msgs::TxComplete,
762762
) -> Result<(Option<InteractiveTxMessageSend>, Option<Transaction>), AbortReason> {
763-
let _ = do_state_transition!(self, received_tx_complete, msg)?;
763+
do_state_transition!(self, received_tx_complete, msg)?;
764764
match &self.state_machine {
765765
StateMachine::ReceivedTxComplete(_) => {
766766
let msg_send = self.do_local_state_transition()?;

0 commit comments

Comments
 (0)