Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 2,289 Lines • ▼ Show 20 Lines | if (strCommand == NetMsgType::VERSION) { | ||||
// Ignore time offsets that are improbable (before the Genesis block) | // Ignore time offsets that are improbable (before the Genesis block) | ||||
// and may underflow the nTimeOffset calculation. | // and may underflow the nTimeOffset calculation. | ||||
int64_t currentTime = GetTime(); | int64_t currentTime = GetTime(); | ||||
if (nTime >= int64_t(chainparams.GenesisBlock().nTime)) { | if (nTime >= int64_t(chainparams.GenesisBlock().nTime)) { | ||||
int64_t nTimeOffset = nTime - currentTime; | int64_t nTimeOffset = nTime - currentTime; | ||||
pfrom->nTimeOffset = nTimeOffset; | pfrom->nTimeOffset = nTimeOffset; | ||||
AddTimeData(pfrom->addr, nTimeOffset); | AddTimeData(pfrom->addr, nTimeOffset); | ||||
} else { | } else { | ||||
LOCK(cs_main); | |||||
Misbehaving(pfrom, 20, | Misbehaving(pfrom, 20, | ||||
"Ignoring invalid timestamp in version message"); | "Ignoring invalid timestamp in version message"); | ||||
} | } | ||||
// Feeler connections exist only to verify if address is online. | // Feeler connections exist only to verify if address is online. | ||||
if (pfrom->fFeeler) { | if (pfrom->fFeeler) { | ||||
assert(pfrom->fInbound == false); | assert(pfrom->fInbound == false); | ||||
pfrom->fDisconnect = true; | pfrom->fDisconnect = true; | ||||
▲ Show 20 Lines • Show All 2,560 Lines • Show Last 20 Lines |