X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Futil%2Fevents.rs;h=e11e4e82c1ccbf2b735c804ab288c4ea215bc13e;hb=c662dd3e946749f2c4a4c7e3169963d4e7906048;hp=a317f076658acac1f984f2df6c8b6cbcb2c5ff6e;hpb=c52616ddd7b6ac02ed3595d10dd3190a3534c5e1;p=rust-lightning diff --git a/src/util/events.rs b/src/util/events.rs index a317f076..e11e4e82 100644 --- a/src/util/events.rs +++ b/src/util/events.rs @@ -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 + }, + /// 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, } }