mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
i2p: avoid using Sock::Get() for checking for a valid socket
Peeking at the underlying socket file descriptor of `Sock` and checkig if it is `INVALID_SOCKET` is bad encapsulation and stands in the way of testing/mocking/fuzzing. Instead use an empty unique_ptr to denote that there is no valid socket.
This commit is contained in:
@@ -261,6 +261,7 @@ private:
|
||||
* ("SESSION CREATE"). With the established session id we later open
|
||||
* other connections to the SAM service to accept incoming I2P
|
||||
* connections and make outgoing ones.
|
||||
* If not connected then this unique_ptr will be empty.
|
||||
* See https://geti2p.net/en/docs/api/samv3
|
||||
*/
|
||||
std::unique_ptr<Sock> m_control_sock GUARDED_BY(m_mutex);
|
||||
|
||||
Reference in New Issue
Block a user