Skip to content

Commit 222d7c7

Browse files
committed
Refactor to remove pointless NodeAddress() function
1 parent 5b15254 commit 222d7c7

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

src/main.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#include <ctime>
3535
#include <math.h>
3636

37-
extern std::string NodeAddress(CNode* pfrom);
3837
extern bool WalletOutOfSync();
3938
extern bool AskForOutstandingBlocks(uint256 hashStart);
4039
extern void ResetTimerMain(std::string timer_name);
@@ -4375,13 +4374,6 @@ bool static AlreadyHave(CTxDB& txdb, const CInv& inv)
43754374
// a large 4-byte int at any alignment.
43764375
unsigned char pchMessageStart[4] = { 0x70, 0x35, 0x22, 0x05 };
43774376

4378-
4379-
std::string NodeAddress(CNode* pfrom)
4380-
{
4381-
std::string ip = pfrom->addr.ToString();
4382-
return ip;
4383-
}
4384-
43854377
bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, int64_t nTimeReceived)
43864378
{
43874379
RandAddSeedPerfmon();
@@ -4577,7 +4569,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
45774569
else if (pfrom->nVersion == 0)
45784570
{
45794571
// Must have a version message before anything else 1-10-2015 Halford
4580-
LogPrintf("Hack attempt from %s - %s (banned) ",pfrom->addrName, NodeAddress(pfrom));
4572+
LogPrintf("Hack attempt from %s - %s (banned) ", pfrom->addrName, pfrom->addr.ToString());
45814573
pfrom->Misbehaving(100);
45824574
pfrom->fDisconnect=true;
45834575
return false;

src/net.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#endif
3535

3636
using namespace std;
37-
std::string NodeAddress(CNode* pfrom);
3837

3938
extern int nMaxConnections;
4039
int MAX_OUTBOUND_CONNECTIONS = 8;
@@ -1305,7 +1304,7 @@ void ThreadSocketHandler2(void* parg)
13051304
if ((GetAdjustedTime() - pnode->nTimeConnected) > (60*60*2) && (vNodes.size() > (MAX_OUTBOUND_CONNECTIONS*.75)))
13061305
{
13071306
LogPrint(BCLog::LogFlags::NOISY, "Node %s connected longer than 2 hours with connection count of %zd, disconnecting. ",
1308-
NodeAddress(pnode), vNodes.size());
1307+
pnode->addr.ToString(), vNodes.size());
13091308

13101309
pnode->fDisconnect = true;
13111310

0 commit comments

Comments
 (0)