Skip to content

Commit ba7e9e9

Browse files
fixup! blip42: Add ContactInfo field to PaymentSent event for contact management
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
1 parent 62808ec commit ba7e9e9

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

lightning/src/ln/outbound_payment.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,7 @@ where
10891089
let contact_secrets = ContactSecrets::new(
10901090
contact_secret_bytes.try_into().ok()?
10911091
);
1092+
10921093
let payer_offer = Offer::try_from(payer_offer_bytes.to_vec()).ok()?;
10931094

10941095
Some(events::ContactInfo { contact_secrets, payer_offer })
@@ -1112,17 +1113,19 @@ where
11121113
let payer_offer_bytes = invreq.payer_offer();
11131114

11141115
match (contact_secret_bytes, payer_offer_bytes) {
1115-
(Some(secret), Some(offer_bytes)) => {
1116+
(Some(secret), Some(payer_offer_bytes)) => {
11161117
use crate::offers::contacts::ContactSecrets;
1117-
use crate::offers::offer::Offer;
11181118

11191119
let contact_secrets = secret.try_into().ok()
11201120
.map(|s| ContactSecrets::new(s));
1121-
let payer_offer = Offer::try_from(offer_bytes.to_vec()).ok();
11221121

1123-
contact_secrets.and_then(|cs| payer_offer.map(|po|
1124-
events::ContactInfo { contact_secrets: cs, payer_offer: po }
1125-
))
1122+
let payer_offer = crate::offers::offer::Offer::try_from(payer_offer_bytes.to_vec()).ok();
1123+
1124+
contact_secrets.and_then(|cs|
1125+
payer_offer.and_then(|po|
1126+
Some(events::ContactInfo { contact_secrets: cs, payer_offer: po })
1127+
)
1128+
)
11261129
},
11271130
_ => None,
11281131
}

0 commit comments

Comments
 (0)