Mercurial > hg > bitcoin
changeset 283:ba794fc90b7d draft
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
author | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> |
---|---|
date | Mon, 11 Oct 2010 15:12:17 +0000 |
parents | 9a20e4a6d6bb |
children | 163e140e74f5 |
files | main.cpp util.cpp |
diffstat | 2 files changed, 12 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/main.cpp +++ b/main.cpp @@ -2433,15 +2433,20 @@ { // 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 @@ 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 @@ 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) {
--- a/util.cpp +++ b/util.cpp @@ -572,7 +572,7 @@ strMiscWarning = pszMessage; #ifdef GUI if (wxTheApp && !fDaemon) - boost::thread(bind(ThreadOneMessageBox, string(pszMessage))); + boost::thread(boost::bind(ThreadOneMessageBox, string(pszMessage))); #endif } @@ -807,7 +807,7 @@ string strMessage = _("Warning: Please check that your computer's date and time are correct. If your clock is wrong Bitcoin will not work properly."); strMiscWarning = strMessage; printf("*** %s\n", strMessage.c_str()); - boost::thread(bind(ThreadSafeMessageBox, strMessage+" ", string("Bitcoin"), wxOK | wxICON_EXCLAMATION, (wxWindow*)NULL, -1, -1)); + boost::thread(boost::bind(ThreadSafeMessageBox, strMessage+" ", string("Bitcoin"), wxOK | wxICON_EXCLAMATION, (wxWindow*)NULL, -1, -1)); } } foreach(int64 n, vTimeOffsets)