aboutsummaryrefslogtreecommitdiff
path: root/net.cpp
diff options
context:
space:
mode:
authors_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-06-10 23:10:30 +0000
committers_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-06-10 23:10:30 +0000
commitf93d5f9ffe1e12079e560a735111735924726a06 (patch)
tree0a34330f01acf1a2cd18f5a9f8c36ec29216a3e8 /net.cpp
parent2ca17588327858947590fda78d68cfad79e633bc (diff)
automatically change displayed address whenever it receives anything,v0.2.10
added help and -? for daemon command line rpc commands, only relay addr messages to 5 random nodes to save bandwidth, started setting wtx.fFromMe flag, trickle out tx inventory messages to protect privacy -- version 0.2.10 git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@81 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'net.cpp')
-rw-r--r--net.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/net.cpp b/net.cpp
index fbfa746221..c5659dc923 100644
--- a/net.cpp
+++ b/net.cpp
@@ -1019,7 +1019,6 @@ void ThreadMessageHandler2(void* parg)
SetThreadPriority(THREAD_PRIORITY_BELOW_NORMAL);
while (!fShutdown)
{
- // Poll the connected nodes for messages
vector<CNode*> vNodesCopy;
CRITICAL_BLOCK(cs_vNodes)
{
@@ -1027,6 +1026,11 @@ void ThreadMessageHandler2(void* parg)
foreach(CNode* pnode, vNodesCopy)
pnode->AddRef();
}
+
+ // Poll the connected nodes for messages
+ CNode* pnodeTrickle = NULL;
+ if (!vNodesCopy.empty())
+ pnodeTrickle = vNodesCopy[GetRand(vNodesCopy.size())];
foreach(CNode* pnode, vNodesCopy)
{
// Receive messages
@@ -1037,10 +1041,11 @@ void ThreadMessageHandler2(void* parg)
// Send messages
TRY_CRITICAL_BLOCK(pnode->cs_vSend)
- SendMessages(pnode);
+ SendMessages(pnode, pnode == pnodeTrickle);
if (fShutdown)
return;
}
+
CRITICAL_BLOCK(cs_vNodes)
{
foreach(CNode* pnode, vNodesCopy)