},
7 => {
if should_forward {
- channelmanager.process_pending_htlc_forward();
+ channelmanager.process_pending_htlc_forwards();
handler.process_events();
should_forward = false;
}
}))
}
- pub fn process_pending_htlc_forward(&self) {
+ /// Processes HTLCs which are pending waiting on random forward delay.
+ /// Should only really ever be called in response to an PendingHTLCsForwardable event.
+ /// Will likely generate further events.
+ pub fn process_pending_htlc_forwards(&self) {
let mut new_events = Vec::new();
let mut failed_forwards = Vec::new();
{
};
node.node.channel_state.lock().unwrap().next_forward = Instant::now();
- node.node.process_pending_htlc_forward();
+ node.node.process_pending_htlc_forwards();
let mut events_2 = node.node.get_and_clear_pending_events();
assert_eq!(events_2.len(), 1);
Event::PaymentReceived {..} => { /* Hand upstream */ },
Event::PaymentSent {..} => { /* Hand upstream */ },
Event::PaymentFailed {..} => { /* Hand upstream */ },
+ Event::PendingHTLCsForwardable {..} => { /* Hand upstream */ },
- Event::PendingHTLCsForwardable {..} => {
- //TODO: Handle upstream in some confused form so that upstream just knows
- //to call us somehow?
- },
Event::SendOpenChannel { ref node_id, ref msg } => {
let (mut descriptor, peer) = get_peer_for_forwarding!(node_id, {
//TODO: Drop the pending channel? (or just let it timeout, but that sucks)
PaymentFailed {
payment_hash: [u8; 32],
},
-
- // Events indicating the network loop should send a message to a peer:
/// Used to indicate that ChannelManager::process_pending_htlc_forwards should be called at a
/// time in the future.
PendingHTLCsForwardable {
time_forwardable: Instant,
},
+
+ // Events indicating the network loop should send a message to a peer:
/// Used to indicate that we've initialted a channel open and should send the open_channel
/// message provided to the given peer
SendOpenChannel {