X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fln%2Fchannelmanager.rs;h=c674c269616febc6ad97f95c301ef72462f0d126;hb=d7c1cfcc22a11a65547c5c6e611a1f8f1584b440;hp=174f63cc76cbff7c95f212d79fc83f7c92c59c1e;hpb=29906e7995f19c7bcfbe1bb3d8f6e5d3f0c88161;p=rust-lightning diff --git a/src/ln/channelmanager.rs b/src/ln/channelmanager.rs index 174f63cc..c674c269 100644 --- a/src/ln/channelmanager.rs +++ b/src/ln/channelmanager.rs @@ -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(); { @@ -958,7 +961,7 @@ impl ChannelManager { pub fn claim_funds(&self, payment_preimage: [u8; 32]) -> bool { self.claim_funds_internal(payment_preimage, true) } - pub fn claim_funds_internal(&self, payment_preimage: [u8; 32], from_user: bool) -> bool { + fn claim_funds_internal(&self, payment_preimage: [u8; 32], from_user: bool) -> bool { let mut sha = Sha256::new(); sha.input(&payment_preimage); let mut payment_hash = [0; 32]; @@ -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);