aboutsummaryrefslogtreecommitdiff
path: root/net.h
diff options
context:
space:
mode:
authors_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-10-23 17:43:53 +0000
committers_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-10-23 17:43:53 +0000
commitc891967b6fcab2e8dc4ce0c787312b36c07efa4d (patch)
tree8cf0e07b5ba8f88bfdbdb11b70722014d424767c /net.h
parentc285051c0895b52a87b529f61256e1fda8070926 (diff)
downloadbitcoin-c891967b6fcab2e8dc4ce0c787312b36c07efa4d.tar.xz
bugfixes from Dean Gores,
addr system changes, make sure no gen before block 74000 git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@173 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'net.h')
-rw-r--r--net.h20
1 files changed, 7 insertions, 13 deletions
diff --git a/net.h b/net.h
index 33c59147bb..f07081619a 100644
--- a/net.h
+++ b/net.h
@@ -24,7 +24,7 @@ enum
bool ConnectSocket(const CAddress& addrConnect, SOCKET& hSocketRet);
bool GetMyExternalIP(unsigned int& ipRet);
-bool AddAddress(CAddress addr);
+bool AddAddress(CAddress addr, int64 nTimePenalty=0);
void AddressCurrentlyConnected(const CAddress& addr);
CNode* FindNode(unsigned int ip);
CNode* ConnectNode(CAddress addrConnect, int64 nTimeout=0);
@@ -139,7 +139,7 @@ public:
unsigned int ip;
unsigned short port;
- // disk only
+ // disk and network only
unsigned int nTime;
// memory only
@@ -186,7 +186,7 @@ public:
memcpy(pchReserved, pchIPv4, sizeof(pchReserved));
ip = INADDR_NONE;
port = GetDefaultPort();
- nTime = GetAdjustedTime();
+ nTime = 100000000;
nLastTry = 0;
}
@@ -218,11 +218,12 @@ public:
IMPLEMENT_SERIALIZE
(
+ if (fRead)
+ const_cast<CAddress*>(this)->Init();
if (nType & SER_DISK)
- {
READWRITE(nVersion);
+ if ((nType & SER_DISK) || (nVersion >= 31402 && !(nType & SER_GETHASH)))
READWRITE(nTime);
- }
READWRITE(nServices);
READWRITE(FLATDATA(pchReserved)); // for IPv6
READWRITE(ip);
@@ -415,7 +416,7 @@ public:
const char* GetCommand() const
{
if (!IsKnownType())
- throw std::out_of_range(strprintf("CInv::GetCommand() : type=% unknown type", type));
+ throw std::out_of_range(strprintf("CInv::GetCommand() : type=%d unknown type", type));
return ppszTypeName[type];
}
@@ -732,13 +733,6 @@ public:
AbortMessage();
}
- const char* GetMessageCommand() const
- {
- if (nHeaderStart == -1)
- return "";
- return &vSend[nHeaderStart] + offsetof(CMessageHeader, pchCommand);
- }
-