]> git.bitcoin.ninja Git - ldk-sample/commit
Generate random `PaymentId` for outbound offers
authorElias Rohrer <dev@tnull.de>
Fri, 8 Mar 2024 13:32:39 +0000 (14:32 +0100)
committerElias Rohrer <dev@tnull.de>
Fri, 8 Mar 2024 13:32:39 +0000 (14:32 +0100)
commit4a1a645819fa18609ccaf9f6a9c4ddfd55519dd5
tree50466679fb2de0505bc4278f6d69be9f01ab8489
parent78659f37455b947bc1e658d9bf667f20b19985bc
Generate random `PaymentId` for outbound offers

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 `PaymentId`s to avoid collisions, even if
offers are paid multiple times.
src/cli.rs