@@ -2543,26 +2543,24 @@ impl FailHTLCContents for msgs::OnionErrorPacket {
2543
2543
HTLCUpdateAwaitingACK::FailHTLC { htlc_id, err_packet: self }
2544
2544
}
2545
2545
}
2546
- impl FailHTLCContents for (u16, [u8; 32]) {
2546
+ impl FailHTLCContents for ([u8; 32], u16 ) {
2547
2547
type Message = msgs::UpdateFailMalformedHTLC; // (failure_code, sha256_of_onion)
2548
2548
fn to_message(self, htlc_id: u64, channel_id: ChannelId) -> Self::Message {
2549
2549
msgs::UpdateFailMalformedHTLC {
2550
2550
htlc_id,
2551
2551
channel_id,
2552
- failure_code : self.0,
2553
- sha256_of_onion : self.1
2552
+ sha256_of_onion : self.0,
2553
+ failure_code : self.1
2554
2554
}
2555
2555
}
2556
2556
fn to_inbound_htlc_state(self) -> InboundHTLCState {
2557
- InboundHTLCState::LocalRemoved(
2558
- InboundHTLCRemovalReason::FailMalformed((self.1, self.0))
2559
- )
2557
+ InboundHTLCState::LocalRemoved(InboundHTLCRemovalReason::FailMalformed(self))
2560
2558
}
2561
2559
fn to_htlc_update_awaiting_ack(self, htlc_id: u64) -> HTLCUpdateAwaitingACK {
2562
2560
HTLCUpdateAwaitingACK::FailMalformedHTLC {
2563
2561
htlc_id,
2564
- failure_code : self.0,
2565
- sha256_of_onion : self.1
2562
+ sha256_of_onion : self.0,
2563
+ failure_code : self.1
2566
2564
}
2567
2565
}
2568
2566
}
@@ -2888,7 +2886,7 @@ impl<SP: Deref> Channel<SP> where
2888
2886
pub fn queue_fail_malformed_htlc<L: Deref>(
2889
2887
&mut self, htlc_id_arg: u64, failure_code: u16, sha256_of_onion: [u8; 32], logger: &L
2890
2888
) -> Result<(), ChannelError> where L::Target: Logger {
2891
- self.fail_htlc(htlc_id_arg, (failure_code, sha256_of_onion ), true, logger)
2889
+ self.fail_htlc(htlc_id_arg, (sha256_of_onion, failure_code ), true, logger)
2892
2890
.map(|msg_opt| assert!(msg_opt.is_none(), "We forced holding cell?"))
2893
2891
}
2894
2892
@@ -3625,7 +3623,7 @@ impl<SP: Deref> Channel<SP> where
3625
3623
.map(|fail_msg_opt| fail_msg_opt.map(|_| ())))
3626
3624
},
3627
3625
&HTLCUpdateAwaitingACK::FailMalformedHTLC { htlc_id, failure_code, sha256_of_onion } => {
3628
- Some(self.fail_htlc(htlc_id, (failure_code, sha256_of_onion ), false, logger)
3626
+ Some(self.fail_htlc(htlc_id, (sha256_of_onion, failure_code ), false, logger)
3629
3627
.map(|fail_msg_opt| fail_msg_opt.map(|_| ())))
3630
3628
}
3631
3629
};
0 commit comments