]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Make attempting to retry a succeeded payment an APIError, not Route 2021-12-fix-retries-races
authorMatt Corallo <git@bluematt.me>
Mon, 13 Dec 2021 17:41:36 +0000 (17:41 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 15 Dec 2021 03:57:13 +0000 (03:57 +0000)
This is symmetric with the new failure once a payment is abandoned.

lightning/src/ln/channelmanager.rs

index 4caa5435eac0efdd3cf1e1259e99f0092121ed8e..bd3b3683e8900dca43f0819d7b4dee9040dca29e 100644 (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 { .. } => {