p2p, refactor: pass and use uint16_t CService::port as uint16_t

This commit is contained in:
Jon Atack
2021-03-01 21:35:28 +01:00
parent 1b6c463e03
commit 6423c8175f
17 changed files with 48 additions and 47 deletions

View File

@@ -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;