Fix XXXs that slipped into router and handle HTLCFailCHannelUpdates
[rust-lightning] / src / util / events.rs
index a317f076658acac1f984f2df6c8b6cbcb2c5ff6e..e11e4e82c1ccbf2b735c804ab288c4ea215bc13e 100644 (file)
@@ -75,6 +75,10 @@ pub enum Event {
        PaymentFailed {
                /// The hash which was given to ChannelManager::send_payment.
                payment_hash: [u8; 32],
+               /// Indicates the payment was rejected for some reason by the recipient. This implies that
+               /// the payment has failed, not just the route in question. If this is not set, you may
+               /// retry the payment via a different route.
+               rejected_by_dest: bool,
        },
        /// Used to indicate that ChannelManager::process_pending_htlc_forwards should be called at a
        /// time in the future.
@@ -125,6 +129,15 @@ pub enum Event {
                /// The update messages which should be sent. ALL messages in the struct should be sent!
                updates: msgs::CommitmentUpdate,
        },
+       /// Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
+       ///
+       /// This event is handled by PeerManager::process_events if you are using a PeerManager.
+       SendRevokeAndACK {
+               /// The node_id of the node which should receive this message
+               node_id: PublicKey,
+               /// The message which should be sent.
+               msg: msgs::RevokeAndACK,
+       },
        /// Used to indicate that a shutdown message should be sent to the peer with the given node_id.
        ///
        /// This event is handled by PeerManager::process_events if you are using a PeerManager.
@@ -161,6 +174,14 @@ pub enum Event {
                node_id: PublicKey,
                /// The action which should be taken.
                action: Option<msgs::ErrorAction>
+       },
+       /// When a payment fails we may receive updates back from the hop where it failed. In such
+       /// cases this event is generated so that we can inform the router of this information.
+       ///
+       /// This event is handled by PeerManager::process_events if you are using a PeerManager.
+       PaymentFailureNetworkUpdate {
+               /// The channel/node update which should be sent to router
+               update: msgs::HTLCFailChannelUpdate,
        }
 }