+ /// Broadcast an error downstream to be handled
+ HandleError {
+ /// The node_id of the node which should receive this message
+ node_id: PublicKey,
+ /// The action which should be taken.
+ action: 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.
+ PaymentFailureNetworkUpdate {
+ /// The channel/node update which should be sent to router
+ update: msgs::HTLCFailChannelUpdate,
+ }
+}
+
+/// A trait indicating an object may generate message send events
+pub trait MessageSendEventsProvider {
+ /// Gets the list of pending events which were generated by previous actions, clearing the list
+ /// in the process.
+ fn get_and_clear_pending_msg_events(&self) -> Vec<MessageSendEvent>;