mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-03-15 15:39:09 +01:00
PendingHTLCsForwardable really should just be upstreamed.
This is just a comment/docs/function rename change
This commit is contained in:
parent
29906e7995
commit
af5c6e8186
4 changed files with 9 additions and 9 deletions
|
@ -263,7 +263,7 @@ pub fn do_test(data: &[u8]) {
|
|||
},
|
||||
7 => {
|
||||
if should_forward {
|
||||
channelmanager.process_pending_htlc_forward();
|
||||
channelmanager.process_pending_htlc_forwards();
|
||||
handler.process_events();
|
||||
should_forward = false;
|
||||
}
|
||||
|
|
|
@ -766,7 +766,10 @@ impl ChannelManager {
|
|||
}))
|
||||
}
|
||||
|
||||
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();
|
||||
{
|
||||
|
@ -2359,7 +2362,7 @@ mod tests {
|
|||
};
|
||||
|
||||
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);
|
||||
|
|
|
@ -628,11 +628,8 @@ impl<Descriptor: SocketDescriptor> PeerManager<Descriptor> {
|
|||
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)
|
||||
|
|
|
@ -46,13 +46,13 @@ pub enum Event {
|
|||
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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue