From 99abd06b8724ac35aed52372fb2940c718badd9c Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 22 Oct 2014 19:22:06 -0700 Subject: [PATCH] cleanup. --- src/bitcoindjs.cc | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/bitcoindjs.cc b/src/bitcoindjs.cc index 7bc2ba7d..14c3d987 100644 --- a/src/bitcoindjs.cc +++ b/src/bitcoindjs.cc @@ -291,9 +291,6 @@ process_packets(CNode* pfrom); static bool process_packet(CNode* pfrom, string strCommand, CDataStream& vRecv, int64_t nTimeReceived); -// bool static -// process_getdata(CNode* pfrom); - extern "C" void init(Handle); @@ -3884,8 +3881,10 @@ process_packets(CNode* pfrom) { it++; // Scan for message start - if (memcmp(msg.hdr.pchMessageStart, Params().MessageStart(), MESSAGE_START_SIZE) != 0) { - LogPrintf("PROCESSMESSAGE: INVALID MESSAGESTART %s peer=%d\n", msg.hdr.GetCommand(), pfrom->id); + if (memcmp(msg.hdr.pchMessageStart, + Params().MessageStart(), MESSAGE_START_SIZE) != 0) { + LogPrintf("PROCESSMESSAGE: INVALID MESSAGESTART %s peer=%d\n", + msg.hdr.GetCommand(), pfrom->id); fOk = false; break; } @@ -3893,7 +3892,8 @@ process_packets(CNode* pfrom) { // Read header CMessageHeader& hdr = msg.hdr; if (!hdr.IsValid()) { - LogPrintf("PROCESSMESSAGE: ERRORS IN HEADER %s peer=%d\n", hdr.GetCommand(), pfrom->id); + LogPrintf("PROCESSMESSAGE: ERRORS IN HEADER %s peer=%d\n", + hdr.GetCommand(), pfrom->id); continue; } string strCommand = hdr.GetCommand(); @@ -3907,7 +3907,9 @@ process_packets(CNode* pfrom) { unsigned int nChecksum = 0; memcpy(&nChecksum, &hash, sizeof(nChecksum)); if (nChecksum != hdr.nChecksum) { - LogPrintf("ProcessMessages(%s, %u bytes) : CHECKSUM ERROR nChecksum=%08x hdr.nChecksum=%08x\n", + LogPrintf( + "ProcessMessages(%s, %u bytes) :" + " CHECKSUM ERROR nChecksum=%08x hdr.nChecksum=%08x\n", strCommand, nMessageSize, nChecksum, hdr.nChecksum); continue; } @@ -3917,8 +3919,10 @@ process_packets(CNode* pfrom) { fRet = process_packet(pfrom, strCommand, vRecv, msg.nTime); boost::this_thread::interruption_point(); - if (!fRet) - LogPrintf("ProcessMessage(%s, %u bytes) FAILED peer=%d\n", strCommand, nMessageSize, pfrom->id); + if (!fRet) { + LogPrintf("ProcessMessage(%s, %u bytes) FAILED peer=%d\n", + strCommand, nMessageSize, pfrom->id); + } break; } @@ -4014,11 +4018,6 @@ process_packet(CNode* pfrom, string strCommand, CDataStream& vRecv, int64_t nTim return true; } -// bool static -// process_getdata(CNode* pfrom) { -// return true; -// } - /** * Init() * Initialize the singleton object known as bitcoindjs.