Make attempting to retry a succeeded payment an APIError, not Route

This is symmetric with the new failure once a payment is abandoned.
This commit is contained in:
Matt Corallo 2021-12-13 17:41:36 +00:00
parent 3086bd8c8e
commit 05d7a33a58

View file

@ -2393,8 +2393,8 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
}))
},
PendingOutboundPayment::Fulfilled { .. } => {
return Err(PaymentSendFailure::ParameterError(APIError::RouteError {
err: "Payment already completed"
return Err(PaymentSendFailure::ParameterError(APIError::APIMisuseError {
err: "Payment already completed".to_owned()
}));
},
PendingOutboundPayment::Abandoned { .. } => {