mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 03:47:29 -03:00
test: improve debug log message from P2PConnection::connection_made()
This is used in both cases - TCP server (accept) and TCP client (connect). The message "Connected & Listening address:port" is confusing. Print both ends of the TCP connection.
This commit is contained in:
parent
4c526f575c
commit
ba621ffb9c
1 changed files with 6 additions and 1 deletions
|
@ -217,7 +217,12 @@ class P2PConnection(asyncio.Protocol):
|
|||
def connection_made(self, transport):
|
||||
"""asyncio callback when a connection is opened."""
|
||||
assert not self._transport
|
||||
logger.debug("Connected & Listening: %s:%d" % (self.dstaddr, self.dstport))
|
||||
info = transport.get_extra_info("socket")
|
||||
us = info.getsockname()
|
||||
them = info.getpeername()
|
||||
logger.debug(f"Connected: us={us[0]}:{us[1]}, them={them[0]}:{them[1]}")
|
||||
self.dstaddr = them[0]
|
||||
self.dstport = them[1]
|
||||
self._transport = transport
|
||||
# in an inbound connection to the TestNode with P2PConnection as the initiator, [TestNode <---- P2PConnection]
|
||||
# send the initial handshake immediately
|
||||
|
|
Loading…
Reference in a new issue