Not sure whether this is desirable, so marking as a proof of concept.
This moves the Peer
and PeerManagerImpl
declarations to their own header file, peerman_impl.h
, which can be included by net_processing.cpp
and the test/bench/fuzz files.
The benefits of this are:
PeerManagerImpl
functions which are exposed through thePeerManager
interface for testing, but would otherwise be private can be removed fromPeerManager
. That means thatPeerManager
truly is net_processing’s minimal interface to expose to the rest of the program.- If a test needs to directly manipulate
Peer
objects, it can do so, since they’re exposed in peerman_impl header.