From: wpaulino Date: Sat, 11 Feb 2023 03:57:11 +0000 (-0800) Subject: Merge pull request #1980 from TheBlueMatt/2023-01-async-utxo-lookups X-Git-Tag: v0.0.114-beta~22 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=be4bb58573ab6f56f363496574d64fa83074364b;p=rust-lightning Merge pull request #1980 from TheBlueMatt/2023-01-async-utxo-lookups --- be4bb58573ab6f56f363496574d64fa83074364b diff --cc lightning/src/ln/peer_handler.rs index 37867adff,f24061726..3775c27e4 --- a/lightning/src/ln/peer_handler.rs +++ b/lightning/src/ln/peer_handler.rs @@@ -858,10 -866,23 +878,23 @@@ impl bool { + peer.should_read(self.gossip_processing_backlogged.load(Ordering::Relaxed)) + } + + fn update_gossip_backlogged(&self) { + let new_state = self.message_handler.route_handler.processing_queue_high(); + let prev_state = self.gossip_processing_backlogged.swap(new_state, Ordering::Relaxed); + if prev_state && !new_state { + self.gossip_processing_backlog_lifted.store(true, Ordering::Relaxed); + } + } + + fn do_attempt_write_data(&self, descriptor: &mut Descriptor, peer: &mut Peer, force_one_write: bool) { + let mut have_written = false; while !peer.awaiting_write_event { if peer.should_buffer_onion_message() { - if let Some(peer_node_id) = peer.their_node_id { + if let Some((peer_node_id, _)) = peer.their_node_id { if let Some(next_onion_message) = self.message_handler.onion_message_handler.next_onion_message_for_peer(peer_node_id) { self.enqueue_message(peer, &next_onion_message);