mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
rpc: Add listen address to incoming connections in getpeerinfo
This adds the listening address on which incoming connections were received to the CNode and CNodeStats structures. The address is reported in `getpeerinfo`. This can be useful for distinguishing connections received on different listening ports (e.g. when using a different listening port for Tor hidden service connections) or different networks.
This commit is contained in:
@@ -175,12 +175,12 @@ BOOST_AUTO_TEST_CASE(cnode_simple_test)
|
||||
bool fInboundIn = false;
|
||||
|
||||
// Test that fFeeler is false by default.
|
||||
std::unique_ptr<CNode> pnode1(new CNode(id++, NODE_NETWORK, height, hSocket, addr, 0, 0, pszDest, fInboundIn));
|
||||
std::unique_ptr<CNode> pnode1(new CNode(id++, NODE_NETWORK, height, hSocket, addr, 0, 0, CAddress(), pszDest, fInboundIn));
|
||||
BOOST_CHECK(pnode1->fInbound == false);
|
||||
BOOST_CHECK(pnode1->fFeeler == false);
|
||||
|
||||
fInboundIn = true;
|
||||
std::unique_ptr<CNode> pnode2(new CNode(id++, NODE_NETWORK, height, hSocket, addr, 1, 1, pszDest, fInboundIn));
|
||||
std::unique_ptr<CNode> pnode2(new CNode(id++, NODE_NETWORK, height, hSocket, addr, 1, 1, CAddress(), pszDest, fInboundIn));
|
||||
BOOST_CHECK(pnode2->fInbound == true);
|
||||
BOOST_CHECK(pnode2->fFeeler == false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user