Skip to content

Commit 2731635

Browse files
committed
f Drop redundant preimage lookups
1 parent 1a98154 commit 2731635

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

src/event.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -505,11 +505,8 @@ where
505505
amount_msat,
506506
);
507507
let payment_preimage = match purpose {
508-
PaymentPurpose::Bolt11InvoicePayment { payment_preimage, payment_secret } => {
509-
payment_preimage.or(self
510-
.channel_manager
511-
.get_payment_preimage(payment_hash, payment_secret)
512-
.ok())
508+
PaymentPurpose::Bolt11InvoicePayment { payment_preimage, .. } => {
509+
payment_preimage
513510
},
514511
PaymentPurpose::Bolt12OfferPayment {
515512
payment_preimage,
@@ -551,10 +548,7 @@ where
551548
debug_assert!(false);
552549
},
553550
}
554-
payment_preimage.or(self
555-
.channel_manager
556-
.get_payment_preimage(payment_hash, payment_secret)
557-
.ok())
551+
payment_preimage
558552
},
559553
PaymentPurpose::Bolt12RefundPayment {
560554
payment_preimage,
@@ -592,10 +586,7 @@ where
592586
debug_assert!(false);
593587
},
594588
}
595-
payment_preimage.or(self
596-
.channel_manager
597-
.get_payment_preimage(payment_hash, payment_secret)
598-
.ok())
589+
payment_preimage
599590
},
600591
PaymentPurpose::SpontaneousPayment(preimage) => {
601592
// Since it's spontaneous, we insert it now into our store.

0 commit comments

Comments
 (0)