Skip to content

Commit c52616d

Browse files
committed
Add documentation about PaymentSent/Failed event duplication bug
1 parent 01ba5aa commit c52616d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/util/events.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ pub enum Event {
6060
},
6161
/// Indicates an outbound payment we made succeeded (ie it made it all the way to its target
6262
/// and we got back the payment preimage for it).
63+
/// Note that duplicative PaymentSent Events may be generated - it is your responsibility to
64+
/// deduplicate them by payment_preimage (which MUST be unique)!
6365
PaymentSent {
6466
/// The preimage to the hash given to ChannelManager::send_payment.
6567
/// Note that this serves as a payment receipt, if you wish to have such a thing, you must
@@ -68,6 +70,8 @@ pub enum Event {
6870
},
6971
/// Indicates an outbound payment we made failed. Probably some intermediary node dropped
7072
/// something. You may wish to retry with a different route.
73+
/// Note that duplicative PaymentFailed Events may be generated - it is your responsibility to
74+
/// deduplicate them by payment_hash (which MUST be unique)!
7175
PaymentFailed {
7276
/// The hash which was given to ChannelManager::send_payment.
7377
payment_hash: [u8; 32],

0 commit comments

Comments
 (0)