aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authors_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-10-11 15:12:17 +0000
committers_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-10-11 15:12:17 +0000
commit83082f04a47d6540f40dd656d1baed54eb17e76b (patch)
tree7bb5bc5ef06fc8f28e799b4090022cbb2551aabb /main.cpp
parent103849419a9c014a69c76b6f96e48b66cbc838ca (diff)
downloadbitcoin-83082f04a47d6540f40dd656d1baed54eb17e76b.tar.xz
dkaparis: boost::bind build fix for c++0x
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@164 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/main.cpp b/main.cpp
index 7b04a1f634..569ea5372d 100644
--- a/main.cpp
+++ b/main.cpp
@@ -2433,15 +2433,20 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
{
// Nodes rebroadcast an addr every 24 hours
pfrom->vAddrToSend.clear();
- int64 nSince = GetAdjustedTime() - 6 * 60 * 60; // in the last 6 hours
+ int64 nSince = GetAdjustedTime() - 3 * 60 * 60; // in the last 3 hours
CRITICAL_BLOCK(cs_mapAddresses)
{
+ unsigned int nCount = 0;
foreach(const PAIRTYPE(vector<unsigned char>, CAddress)& item, mapAddresses)
{
- if (fShutdown)
- return true;
const CAddress& addr = item.second;
if (addr.nTime > nSince)
+ nCount++;
+ }
+ foreach(const PAIRTYPE(vector<unsigned char>, CAddress)& item, mapAddresses)
+ {
+ const CAddress& addr = item.second;
+ if (addr.nTime > nSince && GetRand(nCount) < 2000)
pfrom->PushAddress(addr);
}
}
@@ -2780,7 +2785,7 @@ void ThreadBitcoinMiner(void* parg)
vnThreadsRunning[3]--;
PrintException(NULL, "ThreadBitcoinMiner()");
}
- UIThreadCall(bind(CalledSetStatusBar, "", 0));
+ UIThreadCall(boost::bind(CalledSetStatusBar, "", 0));
nHPSTimerStart = 0;
if (vnThreadsRunning[3] == 0)
dHashesPerSec = 0;
@@ -3143,7 +3148,7 @@ void BitcoinMiner()
nHPSTimerStart = GetTimeMillis();
nHashCounter = 0;
string strStatus = strprintf(" %.0f khash/s", dHashesPerSec/1000.0);
- UIThreadCall(bind(CalledSetStatusBar, strStatus, 0));
+ UIThreadCall(boost::bind(CalledSetStatusBar, strStatus, 0));
static int64 nLogTime;
if (GetTime() - nLogTime > 30 * 60)
{