misc small changes to polish after include cleanup

This commit is contained in:
Philip Kaufmann 2013-11-11 16:20:39 +01:00
parent a6aa179699
commit cd696e64df
7 changed files with 14 additions and 21 deletions

View File

@ -1,6 +1,7 @@
// // Copyright (c) 2010 Satoshi Nakamoto
// Alert system // Copyright (c) 2009-2013 The Bitcoin developers
// // Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "alert.h" #include "alert.h"

View File

@ -3,8 +3,6 @@
// Distributed under the MIT/X11 software license, see the accompanying // Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "bitcoinrpc.h" #include "bitcoinrpc.h"
#include "init.h" #include "init.h"
#include "main.h" #include "main.h"

View File

@ -3039,7 +3039,7 @@ void static ProcessGetData(CNode* pfrom)
// Track requests for our stuff. // Track requests for our stuff.
g_signals.Inventory(inv.hash); g_signals.Inventory(inv.hash);
if (inv.type == MSG_BLOCK || inv.type == MSG_FILTERED_BLOCK) if (inv.type == MSG_BLOCK || inv.type == MSG_FILTERED_BLOCK)
break; break;
} }
@ -3576,10 +3576,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
size_t nAvail = vRecv.in_avail(); size_t nAvail = vRecv.in_avail();
bool bPingFinished = false; bool bPingFinished = false;
std::string sProblem; std::string sProblem;
if (nAvail >= sizeof(nonce)) { if (nAvail >= sizeof(nonce)) {
vRecv >> nonce; vRecv >> nonce;
// Only process pong message if there is an outstanding ping (old ping without nonce should never pong) // Only process pong message if there is an outstanding ping (old ping without nonce should never pong)
if (pfrom->nPingNonceSent != 0) { if (pfrom->nPingNonceSent != 0) {
if (nonce == pfrom->nPingNonceSent) { if (nonce == pfrom->nPingNonceSent) {
@ -3610,7 +3610,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
bPingFinished = true; bPingFinished = true;
sProblem = "Short payload"; sProblem = "Short payload";
} }
if (!(sProblem.empty())) { if (!(sProblem.empty())) {
LogPrint("net", "pong %s %s: %s, %"PRIx64" expected, %"PRIx64" received, %"PRIszu" bytes\n", LogPrint("net", "pong %s %s: %s, %"PRIx64" expected, %"PRIx64" received, %"PRIszu" bytes\n",
pfrom->addr.ToString().c_str(), pfrom->addr.ToString().c_str(),
@ -3624,8 +3624,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
pfrom->nPingNonceSent = 0; pfrom->nPingNonceSent = 0;
} }
} }
else if (strCommand == "alert") else if (strCommand == "alert")
{ {
CAlert alert; CAlert alert;
@ -3761,10 +3761,10 @@ bool ProcessMessages(CNode* pfrom)
if (!pfrom->vRecvGetData.empty()) if (!pfrom->vRecvGetData.empty())
ProcessGetData(pfrom); ProcessGetData(pfrom);
// this maintains the order of responses // this maintains the order of responses
if (!pfrom->vRecvGetData.empty()) return fOk; if (!pfrom->vRecvGetData.empty()) return fOk;
std::deque<CNetMessage>::iterator it = pfrom->vRecvMsg.begin(); std::deque<CNetMessage>::iterator it = pfrom->vRecvMsg.begin();
while (!pfrom->fDisconnect && it != pfrom->vRecvMsg.end()) { while (!pfrom->fDisconnect && it != pfrom->vRecvMsg.end()) {
// Don't bother if send buffer is too full to respond anyway // Don't bother if send buffer is too full to respond anyway
@ -3853,7 +3853,7 @@ bool ProcessMessages(CNode* pfrom)
if (!fRet) if (!fRet)
LogPrintf("ProcessMessage(%s, %u bytes) FAILED\n", strCommand.c_str(), nMessageSize); LogPrintf("ProcessMessage(%s, %u bytes) FAILED\n", strCommand.c_str(), nMessageSize);
break; break;
} }

View File

@ -25,7 +25,6 @@
#include <arpa/inet.h> #include <arpa/inet.h>
#endif #endif
//#include <boost/array.hpp>
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include <boost/signals2/signal.hpp> #include <boost/signals2/signal.hpp>
#include <openssl/rand.h> #include <openssl/rand.h>

View File

@ -130,7 +130,6 @@ Value importwallet(const Array& params, bool fHelp)
int64_t nTimeBegin = chainActive.Tip()->nTime; int64_t nTimeBegin = chainActive.Tip()->nTime;
bool fGood = true; bool fGood = true;
while (file.good()) { while (file.good()) {

View File

@ -3,8 +3,6 @@
// Distributed under the MIT/X11 software license, see the accompanying // Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "bitcoinrpc.h" #include "bitcoinrpc.h"
#include "chainparams.h" #include "chainparams.h"
#include "db.h" #include "db.h"

View File

@ -27,8 +27,6 @@
#include <sys/resource.h> #include <sys/resource.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/types.h> #include <sys/types.h>
#else
typedef int pid_t; /* define for Windows compatibility */
#endif #endif
#include <boost/filesystem/path.hpp> #include <boost/filesystem/path.hpp>
@ -109,7 +107,7 @@ inline void MilliSleep(int64_t n)
#elif defined(HAVE_WORKING_BOOST_SLEEP) #elif defined(HAVE_WORKING_BOOST_SLEEP)
boost::this_thread::sleep(boost::posix_time::milliseconds(n)); boost::this_thread::sleep(boost::posix_time::milliseconds(n));
#else #else
//should never get here //should never get here
#error missing boost sleep implementation #error missing boost sleep implementation
#endif #endif
} }