lightningdevkit / ldk-sample

Sample node implementation using LDK
Apache License 2.0
166 stars 94 forks source link

Avoid `offer_hash` `PaymentId` collision #132

Closed tnull closed 7 months ago

tnull commented 7 months ago

Previously, we'd deterministically derive the offer_hash as a PaymentId for outbound BOLT 12 payments. However, as offers may be paid multiple times, this could result in collisions in our outbound_payments store.

Here, we therefore use random PaymentIds to avoid collisions, even if offers are paid multiple times.