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){
3280
3290
Ok(payment_preimage) => payment_preimage,
3281
3291
Err(()) => {
3282
3292
fail_htlc!(claimable_htlc);
3283
3293
continue
3284
3294
}
3285
3295
};
3286
-
let payment_data_total_msat = payment_data.total_msat;
3287
-
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));
3314
-
fail_htlc!(claimable_htlc);
3315
-
continue
3316
-
};
3317
+
if payment_data.is_none(){
3318
+
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));
3319
+
fail_htlc!(claimable_htlc);
3320
+
continue
3321
+
};
3322
+
let payment_data = payment_data.unwrap();
3317
3323
if inbound_payment.get().payment_secret != payment_data.payment_secret{
3318
3324
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