You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Avoid storing a full FinalOnionHopData in OnionPayload::Invoice
We only use it to check the amount when processing MPP parts, but
store the full object (including new payment metadata) in it.
Because we now store the amount in the parent structure, there is
no need for it at all in the `OnionPayload`. Sadly, for
serialization compatibility, we need it to continue to exist, at
least temporarily, but we can avoid populating the new fields in
that case.
let payment_preimage = match inbound_payment::verify(payment_hash,&payment_data,self.highest_seen_timestamp.load(Ordering::Acquire)asu64,&self.inbound_payment_key,&self.logger){
3276
3286
Ok(payment_preimage) => payment_preimage,
3277
3287
Err(()) => {
3278
3288
fail_htlc!(claimable_htlc);
3279
3289
continue
3280
3290
}
3281
3291
};
3282
-
let payment_data_total_msat = payment_data.total_msat;
3283
-
let payment_secret = payment_data.payment_secret.clone();
log_trace!(self.logger,"Failing new keysend HTLC with payment_hash {} because we already have an inbound payment with the same payment hash", log_bytes!(payment_hash.0));
3310
-
fail_htlc!(claimable_htlc);
3311
-
continue
3312
-
};
3313
+
if payment_data.is_none(){
3314
+
log_trace!(self.logger,"Failing new keysend HTLC with payment_hash {} because we already have an inbound payment with the same payment hash", log_bytes!(payment_hash.0));
3315
+
fail_htlc!(claimable_htlc);
3316
+
continue
3317
+
};
3318
+
let payment_data = payment_data.unwrap();
3313
3319
if inbound_payment.get().payment_secret != payment_data.payment_secret{
3314
3320
log_trace!(self.logger,"Failing new HTLC with payment_hash {} as it didn't match our expected payment secret.", log_bytes!(payment_hash.0));
0 commit comments