Add documentation about PaymentSent/Failed event duplication bug 2018-10-reconnect-fixes
authorMatt Corallo <git@bluematt.me>
Tue, 16 Oct 2018 03:04:59 +0000 (23:04 -0400)
committerMatt Corallo <git@bluematt.me>
Tue, 16 Oct 2018 03:06:04 +0000 (23:06 -0400)
src/util/events.rs

index 22721729be1d8ab29ec5504c04142bd3e422ee57..a317f076658acac1f984f2df6c8b6cbcb2c5ff6e 100644 (file)
@@ -60,6 +60,8 @@ pub enum Event {
        },
        /// Indicates an outbound payment we made succeeded (ie it made it all the way to its target
        /// and we got back the payment preimage for it).
+       /// Note that duplicative PaymentSent Events may be generated - it is your responsibility to
+       /// deduplicate them by payment_preimage (which MUST be unique)!
        PaymentSent {
                /// The preimage to the hash given to ChannelManager::send_payment.
                /// 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 {
        },
        /// Indicates an outbound payment we made failed. Probably some intermediary node dropped
        /// something. You may wish to retry with a different route.
+       /// Note that duplicative PaymentFailed Events may be generated - it is your responsibility to
+       /// deduplicate them by payment_hash (which MUST be unique)!
        PaymentFailed {
                /// The hash which was given to ChannelManager::send_payment.
                payment_hash: [u8; 32],