aboutsummaryrefslogtreecommitdiff
path: root/src/util/strencodings.cpp
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2021-03-01 21:35:28 +0100
committerJon Atack <jon@atack.com>2021-03-16 19:52:31 +0100
commit6423c8175fad3163c10ffdb49e0df48e4e4931f1 (patch)
treefe0ad5daa524b4802c6e2d60bcb80043d245d876 /src/util/strencodings.cpp
parent1b6c463e033f861561d1a46ccf7eec069bbac09f (diff)
downloadbitcoin-6423c8175fad3163c10ffdb49e0df48e4e4931f1.tar.xz
p2p, refactor: pass and use uint16_t CService::port as uint16_t
Diffstat (limited to 'src/util/strencodings.cpp')
-rw-r--r--src/util/strencodings.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util/strencodings.cpp b/src/util/strencodings.cpp
index f3d54a2ac9..e9d85c4c30 100644
--- a/src/util/strencodings.cpp
+++ b/src/util/strencodings.cpp
@@ -107,7 +107,8 @@ std::vector<unsigned char> ParseHex(const std::string& str)
return ParseHex(str.c_str());
}
-void SplitHostPort(std::string in, int &portOut, std::string &hostOut) {
+void SplitHostPort(std::string in, uint16_t& portOut, std::string& hostOut)
+{
size_t colon = in.find_last_of(':');
// if a : is found, and it either follows a [...], or no other : is in the string, treat it as port separator
bool fHaveColon = colon != in.npos;