Skip to content

Commit

Permalink
When sending to Bolt12 offers, treat the offer as destination
Browse files Browse the repository at this point in the history
  • Loading branch information
ok300 committed Nov 19, 2024
1 parent 7124f6d commit 81eeb66
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions lib/core/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1308,18 +1308,17 @@ impl Payment {
// If it's a chain swap instead, we use the `claim_address` field from the swap data (either pure Bitcoin or Liquid address).
// Otherwise, we specify the Liquid address (BIP21 or pure), set in `payment_details.address`.
destination: match &swap {
Some(
PaymentSwapData {
swap_type: PaymentSwapType::Receive,
bolt11,
..
}
| PaymentSwapData {
swap_type: PaymentSwapType::Send,
bolt11,
..
},
) => bolt11.clone(),
Some(PaymentSwapData {
swap_type: PaymentSwapType::Receive,
bolt11,
..
}) => bolt11.clone(),
Some(PaymentSwapData {
swap_type: PaymentSwapType::Send,
bolt11,
bolt12_offer,
..
}) => bolt11.clone().or(bolt12_offer.clone()),
Some(PaymentSwapData {
swap_type: PaymentSwapType::Chain,
claim_address,
Expand Down

0 comments on commit 81eeb66

Please sign in to comment.