There is no need for any lock to be held, because net processing is single threaded. So holding the validation lock cs_main for sending a feefilter is confusing and might even degrade blockchain-related RPC performance minimally.
MaybeSendFeefilter
will break when called in multiple threads, because g_filter_rounder.round
isn’t thread safe (among others). Thus, annotating the function with m_mutex_message_handling
seems a nice belt-and-suspenders compiler check for now. If there are more threads in the future, a special feefilter mutex can be introduced.