net: Have LookupNumeric return a CService directly

Also fix up a few small issues:
- Lookup with "badip:port" now sets the port to 0
- Don't allow assert to have side-effects
This commit is contained in:
Cory Fields
2016-08-04 16:37:49 -04:00
parent 21ba407a73
commit 8945384bca
8 changed files with 18 additions and 21 deletions

View File

@@ -327,8 +327,7 @@ QValidator::State ProxyAddressValidator::validate(QString &input, int &pos) cons
{
Q_UNUSED(pos);
// Validate the proxy
CService serv;
LookupNumeric(input.toStdString().c_str(), serv, 9050);
CService serv(LookupNumeric(input.toStdString().c_str(), 9050));
proxyType addrProxy = proxyType(serv, true);
if (addrProxy.IsValid())
return QValidator::Acceptable;