|
|
@ -572,14 +572,9 @@ public: |
|
|
|
fGetAddr = false; |
|
|
|
fGetAddr = false; |
|
|
|
vfSubscribe.assign(256, false); |
|
|
|
vfSubscribe.assign(256, false); |
|
|
|
|
|
|
|
|
|
|
|
// Push a version message
|
|
|
|
// Be shy and don't send version until we hear
|
|
|
|
/// when NTP implemented, change to just nTime = GetAdjustedTime()
|
|
|
|
if (!fInbound) |
|
|
|
int64 nTime = (fInbound ? GetAdjustedTime() : GetTime()); |
|
|
|
PushVersion(); |
|
|
|
CAddress addrYou = (fUseProxy ? CAddress("0.0.0.0") : addr); |
|
|
|
|
|
|
|
CAddress addrMe = (fUseProxy ? CAddress("0.0.0.0") : addrLocalHost); |
|
|
|
|
|
|
|
RAND_bytes((unsigned char*)&nLocalHostNonce, sizeof(nLocalHostNonce)); |
|
|
|
|
|
|
|
PushMessage("version", VERSION, nLocalServices, nTime, addrYou, addrMe, |
|
|
|
|
|
|
|
nLocalHostNonce, string(pszSubVer), nBestHeight); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
~CNode() |
|
|
|
~CNode() |
|
|
@ -736,6 +731,19 @@ public: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void PushVersion() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
/// when NTP implemented, change to just nTime = GetAdjustedTime()
|
|
|
|
|
|
|
|
int64 nTime = (fInbound ? GetAdjustedTime() : GetTime()); |
|
|
|
|
|
|
|
CAddress addrYou = (fUseProxy ? CAddress("0.0.0.0") : addr); |
|
|
|
|
|
|
|
CAddress addrMe = (fUseProxy ? CAddress("0.0.0.0") : addrLocalHost); |
|
|
|
|
|
|
|
RAND_bytes((unsigned char*)&nLocalHostNonce, sizeof(nLocalHostNonce)); |
|
|
|
|
|
|
|
PushMessage("version", VERSION, nLocalServices, nTime, addrYou, addrMe, |
|
|
|
|
|
|
|
nLocalHostNonce, string(pszSubVer), nBestHeight); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void PushMessage(const char* pszCommand) |
|
|
|
void PushMessage(const char* pszCommand) |
|
|
|
{ |
|
|
|
{ |
|
|
|