Skip to content

Commit af8669c

Browse files
committed
tapchannel: aux invoice manager rejects asset payment on btc invoice
Previously we had strict-forwarding protection placed in the AuxInvoiceManager, but that would only protect asset invoices against pure-btc HTLCs. This commit adds the inverse complementary check which prevents settling the invoice if btc ras requested but assets were offered.
1 parent 35d8f1c commit af8669c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tapchannel/aux_invoice_manager.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,13 @@ func (s *AuxInvoiceManager) handleInvoiceAccept(_ context.Context,
164164
resp.CancelSet = true
165165
}
166166

167+
return resp, nil
168+
} else if !isAssetInvoice(req.Invoice, s) && !req.Invoice.IsKeysend {
169+
// If we do have custom records, but the invoice does not
170+
// correspond to an asset invoice, we do not settle the invoice.
171+
// Since we requested btc we should be receiving btc.
172+
resp.CancelSet = true
173+
167174
return resp, nil
168175
}
169176

0 commit comments

Comments
 (0)