X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fchannelmanager.rs;h=c45a0abf4a2ee67c8c9b02612b1ff413119b2398;hb=e0820aee432c49ac88646bbcc17dbbedb6d26298;hp=20014f799ee5db53eec61bd1ad4c66cf3096e0ec;hpb=acff8f6353184211791e4049ce588fa935308467;p=rust-lightning diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 20014f79..c45a0abf 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -2407,10 +2407,10 @@ impl ChannelManager ChannelManager ChannelManager ChannelManager ChannelManager, keysend_preimage: Option, payment_id: PaymentId, recv_value_msat: Option, onion_session_privs: Vec<[u8; 32]>) -> Result<(), PaymentSendFailure> { if route.paths.len() < 1 { - return Err(PaymentSendFailure::ParameterError(APIError::RouteError{err: "There must be at least one path to send over"})); + return Err(PaymentSendFailure::ParameterError(APIError::InvalidRoute{err: "There must be at least one path to send over"})); } if payment_secret.is_none() && route.paths.len() > 1 { return Err(PaymentSendFailure::ParameterError(APIError::APIMisuseError{err: "Payment secret is required for multi-path payments".to_string()})); @@ -2596,12 +2596,12 @@ impl ChannelManager 20 { - path_errs.push(Err(APIError::RouteError{err: "Path didn't go anywhere/had bogus size"})); + path_errs.push(Err(APIError::InvalidRoute{err: "Path didn't go anywhere/had bogus size"})); continue 'path_check; } for (idx, hop) in path.iter().enumerate() { if idx != path.len() - 1 && hop.pubkey == our_node_id { - path_errs.push(Err(APIError::RouteError{err: "Path went through us but wasn't a simple rebalance loop to us"})); + path_errs.push(Err(APIError::InvalidRoute{err: "Path went through us but wasn't a simple rebalance loop to us"})); continue 'path_check; } } @@ -3080,20 +3080,20 @@ impl ChannelManager { if !chan.is_usable() { - return Err(APIError::APIMisuseError { - err: format!("Channel with id {:?} not fully established", next_hop_channel_id) + return Err(APIError::ChannelUnavailable { + err: format!("Channel with id {} not fully established", log_bytes!(*next_hop_channel_id)) }) } chan.get_short_channel_id().unwrap_or(chan.outbound_scid_alias()) }, - None => return Err(APIError::APIMisuseError { - err: format!("Channel with id {:?} not found", next_hop_channel_id) + None => return Err(APIError::ChannelUnavailable { + err: format!("Channel with id {} not found", log_bytes!(*next_hop_channel_id)) }) }; let payment = self.pending_intercepted_htlcs.lock().unwrap().remove(&intercept_id) .ok_or_else(|| APIError::APIMisuseError { - err: format!("Payment with intercept id {:?} not found", intercept_id.0) + err: format!("Payment with intercept id {} not found", log_bytes!(intercept_id.0)) })?; let routing = match payment.forward_info.routing { @@ -3128,7 +3128,7 @@ impl ChannelManager