@@ -51,6 +51,7 @@ use crate::ln::msgs;
51
51
use crate :: ln:: onion_utils;
52
52
use crate :: ln:: onion_utils:: HTLCFailReason ;
53
53
use crate :: ln:: msgs:: { ChannelMessageHandler , DecodeError , LightningError , MAX_VALUE_MSAT } ;
54
+ pub use crate :: ln:: outbound_payment:: PaymentSendFailure ;
54
55
use crate :: ln:: outbound_payment:: PendingOutboundPayment ;
55
56
use crate :: ln:: wire:: Encode ;
56
57
use crate :: chain:: keysinterface:: { Sign , KeysInterface , KeysManager , Recipient } ;
@@ -1099,70 +1100,6 @@ impl ChannelDetails {
1099
1100
}
1100
1101
}
1101
1102
1102
- /// If a payment fails to send, it can be in one of several states. This enum is returned as the
1103
- /// Err() type describing which state the payment is in, see the description of individual enum
1104
- /// states for more.
1105
- #[ derive( Clone , Debug ) ]
1106
- pub enum PaymentSendFailure {
1107
- /// A parameter which was passed to send_payment was invalid, preventing us from attempting to
1108
- /// send the payment at all.
1109
- ///
1110
- /// You can freely resend the payment in full (with the parameter error fixed).
1111
- ///
1112
- /// Because the payment failed outright, no payment tracking is done, you do not need to call
1113
- /// [`ChannelManager::abandon_payment`] and [`ChannelManager::retry_payment`] will *not* work
1114
- /// for this payment.
1115
- ParameterError ( APIError ) ,
1116
- /// A parameter in a single path which was passed to send_payment was invalid, preventing us
1117
- /// from attempting to send the payment at all.
1118
- ///
1119
- /// You can freely resend the payment in full (with the parameter error fixed).
1120
- ///
1121
- /// The results here are ordered the same as the paths in the route object which was passed to
1122
- /// send_payment.
1123
- ///
1124
- /// Because the payment failed outright, no payment tracking is done, you do not need to call
1125
- /// [`ChannelManager::abandon_payment`] and [`ChannelManager::retry_payment`] will *not* work
1126
- /// for this payment.
1127
- PathParameterError ( Vec < Result < ( ) , APIError > > ) ,
1128
- /// All paths which were attempted failed to send, with no channel state change taking place.
1129
- /// You can freely resend the payment in full (though you probably want to do so over different
1130
- /// paths than the ones selected).
1131
- ///
1132
- /// Because the payment failed outright, no payment tracking is done, you do not need to call
1133
- /// [`ChannelManager::abandon_payment`] and [`ChannelManager::retry_payment`] will *not* work
1134
- /// for this payment.
1135
- AllFailedResendSafe ( Vec < APIError > ) ,
1136
- /// Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
1137
- /// yet completed (i.e. generated an [`Event::PaymentSent`]) or been abandoned (via
1138
- /// [`ChannelManager::abandon_payment`]).
1139
- ///
1140
- /// [`Event::PaymentSent`]: events::Event::PaymentSent
1141
- DuplicatePayment ,
1142
- /// Some paths which were attempted failed to send, though possibly not all. At least some
1143
- /// paths have irrevocably committed to the HTLC and retrying the payment in full would result
1144
- /// in over-/re-payment.
1145
- ///
1146
- /// The results here are ordered the same as the paths in the route object which was passed to
1147
- /// send_payment, and any `Err`s which are not [`APIError::MonitorUpdateInProgress`] can be
1148
- /// safely retried via [`ChannelManager::retry_payment`].
1149
- ///
1150
- /// Any entries which contain `Err(APIError::MonitorUpdateInprogress)` or `Ok(())` MUST NOT be
1151
- /// retried as they will result in over-/re-payment. These HTLCs all either successfully sent
1152
- /// (in the case of `Ok(())`) or will send once a [`MonitorEvent::Completed`] is provided for
1153
- /// the next-hop channel with the latest update_id.
1154
- PartialFailure {
1155
- /// The errors themselves, in the same order as the route hops.
1156
- results : Vec < Result < ( ) , APIError > > ,
1157
- /// If some paths failed without irrevocably committing to the new HTLC(s), this will
1158
- /// contain a [`RouteParameters`] object which can be used to calculate a new route that
1159
- /// will pay all remaining unpaid balance.
1160
- failed_paths_retry : Option < RouteParameters > ,
1161
- /// The payment id for the payment, which is now at least partially pending.
1162
- payment_id : PaymentId ,
1163
- } ,
1164
- }
1165
-
1166
1103
/// Route hints used in constructing invoices for [phantom node payents].
1167
1104
///
1168
1105
/// [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
0 commit comments