@@ -2879,18 +2879,18 @@ impl Channel {
2879
2879
2880
2880
/// Begins the shutdown process, getting a message for the remote peer and returning all
2881
2881
/// holding cell HTLCs for payment failure.
2882
- pub fn get_shutdown ( & mut self ) -> Result < ( msgs:: Shutdown , Vec < ( HTLCSource , [ u8 ; 32 ] ) > ) , HandleError > {
2882
+ pub fn get_shutdown ( & mut self ) -> Result < ( msgs:: Shutdown , Vec < ( HTLCSource , [ u8 ; 32 ] ) > ) , APIError > {
2883
2883
for htlc in self . pending_outbound_htlcs . iter ( ) {
2884
2884
if htlc. state == OutboundHTLCState :: LocalAnnounced {
2885
- return Err ( HandleError { err : "Cannot begin shutdown with pending HTLCs, call send_commitment first" , action : None } ) ;
2885
+ return Err ( APIError :: APIMisuseError { err : "Cannot begin shutdown with pending HTLCs. Process pending events first" } ) ;
2886
2886
}
2887
2887
}
2888
2888
if self . channel_state & BOTH_SIDES_SHUTDOWN_MASK != 0 {
2889
- return Err ( HandleError { err : "Shutdown already in progress" , action : None } ) ;
2889
+ return Err ( APIError :: APIMisuseError { err : "Shutdown already in progress" } ) ;
2890
2890
}
2891
2891
assert_eq ! ( self . channel_state & ChannelState :: ShutdownComplete as u32 , 0 ) ;
2892
2892
if self . channel_state & ( ChannelState :: PeerDisconnected as u32 ) == ChannelState :: PeerDisconnected as u32 {
2893
- return Err ( HandleError { err : "Cannot begin shutdown while peer is disconnected, maybe force-close instead?" , action : None } ) ;
2893
+ return Err ( APIError :: APIMisuseError { err : "Cannot begin shutdown while peer is disconnected, maybe force-close instead?" } ) ;
2894
2894
}
2895
2895
2896
2896
let our_closing_script = self . get_closing_scriptpubkey ( ) ;
0 commit comments