X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fln%2Fchannelmanager.rs;h=c674c269616febc6ad97f95c301ef72462f0d126;hb=731aeab1f88db798ae072663365b0ddd9b944cca;hp=06aa6d05271ec0f9ba089a8c5a52daa1845fee73;hpb=f98d4b37d3f291597bc869c3730f62ba274ac474;p=rust-lightning diff --git a/src/ln/channelmanager.rs b/src/ln/channelmanager.rs index 06aa6d05..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); @@ -2595,7 +2598,7 @@ mod tests { let secp_ctx = Secp256k1::new(); for _ in 0..node_count { - let feeest = Arc::new(test_utils::TestFeeEstimator { sat_per_vbyte: 1 }); + let feeest = Arc::new(test_utils::TestFeeEstimator { sat_per_kw: 253 }); let chain_monitor = Arc::new(chaininterface::ChainWatchInterfaceUtil::new()); let tx_broadcaster = Arc::new(test_utils::TestBroadcaster{txn_broadcasted: Mutex::new(Vec::new())}); let chan_monitor = Arc::new(test_utils::TestChannelMonitor::new(chain_monitor.clone(), tx_broadcaster.clone()));