diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2021-12-09 22:45:43 +0100 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2021-12-09 22:45:59 +0100 |
commit | 380f8e539d73f37c2ef5d7133d3e1b6dda105f4a (patch) | |
tree | 505f743d8de3e1fcb20f10e99ab56f81feae8461 /src/network.cpp | |
parent | 1cef5fc2744d2428f28976c7adb0f476d8bc3bcf (diff) |
Test: distinguish address and identity info for peers
Diffstat (limited to 'src/network.cpp')
-rw-r--r-- | src/network.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/network.cpp b/src/network.cpp index 1d38bdd..b735262 100644 --- a/src/network.cpp +++ b/src/network.cpp @@ -116,6 +116,13 @@ optional<Identity> Peer::identity() const return nullopt; } +const sockaddr_in & Peer::address() const +{ + if (auto speer = p->speer.lock()) + return speer->addr; + throw runtime_error("Server no longer running"); +} + void Peer::Priv::notifyWatchers() { if (auto slist = list.lock()) { |