|
|
@ -1899,6 +1899,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) |
|
|
|
return error("message addr size() = %d", vAddr.size()); |
|
|
|
return error("message addr size() = %d", vAddr.size()); |
|
|
|
|
|
|
|
|
|
|
|
// Store the new addresses
|
|
|
|
// Store the new addresses
|
|
|
|
|
|
|
|
CAddrDB addrDB; |
|
|
|
|
|
|
|
addrDB.TxnBegin(); |
|
|
|
int64 nNow = GetAdjustedTime(); |
|
|
|
int64 nNow = GetAdjustedTime(); |
|
|
|
int64 nSince = nNow - 10 * 60; |
|
|
|
int64 nSince = nNow - 10 * 60; |
|
|
|
BOOST_FOREACH(CAddress& addr, vAddr) |
|
|
|
BOOST_FOREACH(CAddress& addr, vAddr) |
|
|
@ -1910,7 +1912,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
if (addr.nTime <= 100000000 || addr.nTime > nNow + 10 * 60) |
|
|
|
if (addr.nTime <= 100000000 || addr.nTime > nNow + 10 * 60) |
|
|
|
addr.nTime = nNow - 5 * 24 * 60 * 60; |
|
|
|
addr.nTime = nNow - 5 * 24 * 60 * 60; |
|
|
|
AddAddress(addr, 2 * 60 * 60); |
|
|
|
AddAddress(addr, 2 * 60 * 60, &addrDB); |
|
|
|
pfrom->AddAddressKnown(addr); |
|
|
|
pfrom->AddAddressKnown(addr); |
|
|
|
if (addr.nTime > nSince && !pfrom->fGetAddr && vAddr.size() <= 10 && addr.IsRoutable()) |
|
|
|
if (addr.nTime > nSince && !pfrom->fGetAddr && vAddr.size() <= 10 && addr.IsRoutable()) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -1941,6 +1943,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
addrDB.TxnCommit(); // Save addresses (it's ok if this fails)
|
|
|
|
if (vAddr.size() < 1000) |
|
|
|
if (vAddr.size() < 1000) |
|
|
|
pfrom->fGetAddr = false; |
|
|
|
pfrom->fGetAddr = false; |
|
|
|
} |
|
|
|
} |
|
|
|