@@ -1113,18 +1113,20 @@ impl OutboundPayments {
1113
1113
}
1114
1114
}
1115
1115
}
1116
- let ( total_msat, recipient_onion, keysend_preimage, onion_session_privs) = {
1116
+ let total_msat = route_params. final_value_msat ;
1117
+ let ( recipient_onion, keysend_preimage, onion_session_privs) = {
1117
1118
let mut outbounds = self . pending_outbound_payments . lock ( ) . unwrap ( ) ;
1118
1119
match outbounds. entry ( payment_id) {
1119
1120
hash_map:: Entry :: Occupied ( mut payment) => {
1120
1121
match payment. get ( ) {
1121
1122
PendingOutboundPayment :: Retryable {
1122
- total_msat, keysend_preimage, payment_secret, payment_metadata,
1123
+ total_msat : retryable_total_msat , keysend_preimage, payment_secret, payment_metadata,
1123
1124
custom_tlvs, pending_amt_msat, ..
1124
1125
} => {
1126
+ debug_assert_eq ! ( total_msat, * retryable_total_msat) ;
1125
1127
const RETRY_OVERFLOW_PERCENTAGE : u64 = 10 ;
1126
1128
let retry_amt_msat = route. get_total_amount ( ) ;
1127
- if retry_amt_msat + * pending_amt_msat > * total_msat * ( 100 + RETRY_OVERFLOW_PERCENTAGE ) / 100 {
1129
+ if retry_amt_msat + * pending_amt_msat > total_msat * ( 100 + RETRY_OVERFLOW_PERCENTAGE ) / 100 {
1128
1130
log_error ! ( logger, "retry_amt_msat of {} will put pending_amt_msat (currently: {}) more than 10% over total_payment_amt_msat of {}" , retry_amt_msat, pending_amt_msat, total_msat) ;
1129
1131
abandon_with_entry ! ( payment, PaymentFailureReason :: UnexpectedError ) ;
1130
1132
return
@@ -1136,7 +1138,6 @@ impl OutboundPayments {
1136
1138
return
1137
1139
}
1138
1140
1139
- let total_msat = * total_msat;
1140
1141
let recipient_onion = RecipientOnionFields {
1141
1142
payment_secret : * payment_secret,
1142
1143
payment_metadata : payment_metadata. clone ( ) ,
@@ -1155,7 +1156,7 @@ impl OutboundPayments {
1155
1156
1156
1157
payment. get_mut ( ) . increment_attempts ( ) ;
1157
1158
1158
- ( total_msat , recipient_onion, keysend_preimage, onion_session_privs)
1159
+ ( recipient_onion, keysend_preimage, onion_session_privs)
1159
1160
} ,
1160
1161
PendingOutboundPayment :: Legacy { .. } => {
1161
1162
log_error ! ( logger, "Unable to retry payments that were initially sent on LDK versions prior to 0.0.102" ) ;
@@ -1166,7 +1167,6 @@ impl OutboundPayments {
1166
1167
return
1167
1168
} ,
1168
1169
PendingOutboundPayment :: InvoiceReceived { payment_hash, retry_strategy, .. } => {
1169
- let total_amount = route_params. final_value_msat ;
1170
1170
let recipient_onion = RecipientOnionFields {
1171
1171
payment_secret : None ,
1172
1172
payment_metadata : None ,
@@ -1179,7 +1179,7 @@ impl OutboundPayments {
1179
1179
retry_strategy, payment_params, entropy_source, best_block_height
1180
1180
) ;
1181
1181
* payment. into_mut ( ) = retryable_payment;
1182
- ( total_amount , recipient_onion, None , onion_session_privs)
1182
+ ( recipient_onion, None , onion_session_privs)
1183
1183
} ,
1184
1184
PendingOutboundPayment :: StaticInvoiceReceived { .. } => todo ! ( ) ,
1185
1185
PendingOutboundPayment :: Fulfilled { .. } => {
0 commit comments