From c58c249a5b694c88122589fedbef4e2f13f08bb4 Mon Sep 17 00:00:00 2001 From: Anthony Towns Date: Fri, 23 Dec 2022 00:21:10 +1000 Subject: net_processing: indicate more work to do when orphans are ready to reconsider When PR#15644 made orphan processing interruptible, it also introduced a potential 100ms delay between processing of the first and second newly reconsiderable orphan, because it didn't check if the orphan work set was non-empty after invoking ProcessMessage(). This adds that check, so that ProcessMessages() will return true if there are orphans to process, usually avoiding the 100ms delay in CConnman::ThreadMessageHandler(). --- src/txorphanage.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/txorphanage.h') diff --git a/src/txorphanage.h b/src/txorphanage.h index f886e07b12..08cfd4e79c 100644 --- a/src/txorphanage.h +++ b/src/txorphanage.h @@ -48,6 +48,9 @@ public: /** Add any orphans that list a particular tx as a parent into the from peer's work set */ void AddChildrenToWorkSet(const CTransaction& tx) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex);; + /** Does this peer have any work to do? */ + bool HaveTxToReconsider(NodeId peer) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex);; + /** Return how many entries exist in the orphange */ size_t Size() EXCLUSIVE_LOCKS_REQUIRED(!m_mutex) { -- cgit v1.2.3