filter out duplicate getblocks and don't relay inv messages during initial block download -- 0.2 rc2

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@49 1a98c847-1fd6-4fd8-948a-caf3550aa51b
This commit is contained in:
s_nakamoto
2009-12-14 02:12:01 +00:00
parent adb50ffe32
commit e2c2648c14
5 changed files with 38 additions and 19 deletions

7
net.h
View File

@@ -7,6 +7,7 @@ class CAddress;
class CInv;
class CRequestTracker;
class CNode;
class CBlockIndex;
@@ -504,6 +505,8 @@ public:
map<uint256, CRequestTracker> mapRequests;
CCriticalSection cs_mapRequests;
uint256 hashContinue;
CBlockIndex* pindexLastGetBlocksBegin;
uint256 hashLastGetBlocksEnd;
// flood
vector<CAddress> vAddrToSend;
@@ -541,6 +544,8 @@ public:
nRefCount = 0;
nReleaseTime = 0;
hashContinue = 0;
pindexLastGetBlocksBegin = 0;
hashLastGetBlocksEnd = 0;
fGetAddr = false;
vfSubscribe.assign(256, false);
@@ -635,6 +640,7 @@ public:
}
void BeginMessage(const char* pszCommand)
{
cs_vSend.Enter();
@@ -900,6 +906,7 @@ public:
void PushGetBlocks(CBlockIndex* pindexBegin, uint256 hashEnd);
bool IsSubscribed(unsigned int nChannel);
void Subscribe(unsigned int nChannel, unsigned int nHops=0);
void CancelSubscribe(unsigned int nChannel);