]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Merge pull request #1980 from TheBlueMatt/2023-01-async-utxo-lookups
authorwpaulino <git@w.paulino.io>
Sat, 11 Feb 2023 03:57:11 +0000 (19:57 -0800)
committerGitHub <noreply@github.com>
Sat, 11 Feb 2023 03:57:11 +0000 (19:57 -0800)
1  2 
lightning/src/ln/channelmanager.rs
lightning/src/ln/peer_handler.rs

Simple merge
index 37867adff32d164caa1f3fc3e78f65f49ff1e8d3,f24061726553f564c6613f9aaf4e437e8b127c70..3775c27e4dff9b0c001303e1ea859b5856431d33
@@@ -858,10 -866,23 +878,23 @@@ impl<Descriptor: SocketDescriptor, CM: 
                Ok(())
        }
  
-       fn do_attempt_write_data(&self, descriptor: &mut Descriptor, peer: &mut Peer) {
+       fn peer_should_read(&self, peer: &mut Peer) -> 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);