Take -port into account when resolving -bind's

This commit is contained in:
Pieter Wuille
2012-05-13 01:26:14 +02:00
parent 139d2f7c29
commit 5a3cb32e59
3 changed files with 8 additions and 9 deletions

View File

@@ -231,11 +231,9 @@ bool AddLocal(const CService& addr, int nScore)
return true;
}
bool AddLocal(const CNetAddr& addr, int nScore, int port)
bool AddLocal(const CNetAddr &addr, int nScore)
{
if (port == -1)
port = GetListenPort();
return AddLocal(CService(addr, port), nScore);
return AddLocal(CService(addr, GetListenPort()), nScore);
}
/** Make a particular network entirely off-limits (no automatic connects to it) */