Revert "fixed regtest+ds issues" (#1524)

This reverts commit 1f828f45ec.

The commit being reverted changed FindNode(const CService& addr)
to make no difference between nodes with the same IP address,
but different ports, but only for regtest network.
As functional tests run several nodes on different ports or the same
IP address (127.0.0.1), this eventually started breaking functional tests.
The only use for regtest network I know is for functional tests,
so it's time to revert that commit.
This commit is contained in:
Oleg Girko 2017-07-13 07:07:50 +01:00 committed by UdjinM6
parent f9dd40888e
commit eea78d45ed

View File

@ -374,16 +374,9 @@ CNode* FindNode(const std::string& addrName)
CNode* FindNode(const CService& addr) CNode* FindNode(const CService& addr)
{ {
LOCK(cs_vNodes); LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes){ BOOST_FOREACH(CNode* pnode, vNodes)
if(Params().NetworkIDString() == CBaseChainParams::REGTEST){ if((CService)pnode->addr == addr)
//if using regtest, just check the IP return (pnode);
if((CNetAddr)pnode->addr == (CNetAddr)addr)
return (pnode);
} else {
if((CService)pnode->addr == addr)
return (pnode);
}
}
return NULL; return NULL;
} }