From aa8fdd76aac664d528a957c148ed575aa444c382 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Mon, 6 Jun 2016 16:55:16 -0700 Subject: [PATCH] fix curly braces --- src/governance.cpp | 9 +++---- src/main.cpp | 59 +++++++++++++++------------------------------- 2 files changed, 22 insertions(+), 46 deletions(-) diff --git a/src/governance.cpp b/src/governance.cpp index 46b318ebba..5a10446e44 100644 --- a/src/governance.cpp +++ b/src/governance.cpp @@ -452,8 +452,7 @@ void CGovernanceManager::Sync(CNode* pfrom, uint256 nProp) // SYNC GOVERNANCE OBJECTS WITH OTHER CLIENT std::map::iterator it1 = mapObjects.begin(); - while(it1 != mapObjects.end()) - { + while(it1 != mapObjects.end()) { uint256 h = (*it1).first; if((*it1).second.fCachedValid && ((nProp == uint256() || (h == nProp)))){ @@ -467,8 +466,7 @@ void CGovernanceManager::Sync(CNode* pfrom, uint256 nProp) // SYNC OUR GOVERNANCE OBJECT VOTES WITH THEIR GOVERNANCE OBJECT VOTES std::map::iterator it2 = mapVotesByHash.begin(); - while(it2 != mapVotesByHash.end()) - { + while(it2 != mapVotesByHash.end()) { pfrom->PushInventory(CInv(MSG_GOVERNANCE_VOTE, (*it2).first)); nInvCount++; ++it2; @@ -518,8 +516,7 @@ bool CGovernanceManager::AddOrUpdateVote(const CGovernanceVote& vote, std::strin uint256 nTypeHash = vote.GetTypeHash(); uint256 nHash = vote.GetHash(); - if(mapVotesByType.count(nTypeHash)) - { + if(mapVotesByType.count(nTypeHash)) { if(mapVotesByType[nTypeHash].nTime > vote.nTime){ strError = strprintf("new vote older than existing vote - %s", nTypeHash.ToString()); LogPrint("mngovernance", "CGovernanceObject::AddOrUpdateVote - %s\n", strError); diff --git a/src/main.cpp b/src/main.cpp index b2a77bc4ab..ec4f665267 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4425,8 +4425,7 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam } // Pruned nodes may have deleted the block, so check whether // it's available before trying to send. - if (send && (mi->second->nStatus & BLOCK_HAVE_DATA)) - { + if (send && (mi->second->nStatus & BLOCK_HAVE_DATA)) { // Send block from disk CBlock block; if (!ReadBlockFromDisk(block, (*mi).second, consensusParams)) @@ -4480,11 +4479,9 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam } } - if (!pushed && inv.type == MSG_TX) - { + if (!pushed && inv.type == MSG_TX) { CTransaction tx; - if (mempool.lookup(inv.hash, tx)) - { + if (mempool.lookup(inv.hash, tx)) { CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); ss.reserve(1000); ss << tx; @@ -4493,10 +4490,8 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam } } - if (!pushed && inv.type == MSG_TXLOCK_VOTE) - { - if(mapTxLockVote.count(inv.hash)) - { + if (!pushed && inv.type == MSG_TXLOCK_VOTE) { + if(mapTxLockVote.count(inv.hash)) { CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); ss.reserve(1000); ss << mapTxLockVote[inv.hash]; @@ -4505,10 +4500,8 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam } } - if (!pushed && inv.type == MSG_TXLOCK_REQUEST) - { - if(mapTxLockReq.count(inv.hash)) - { + if (!pushed && inv.type == MSG_TXLOCK_REQUEST) { + if(mapTxLockReq.count(inv.hash)) { CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); ss.reserve(1000); ss << mapTxLockReq[inv.hash]; @@ -4517,10 +4510,8 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam } } - if (!pushed && inv.type == MSG_SPORK) - { - if(mapSporks.count(inv.hash)) - { + if (!pushed && inv.type == MSG_SPORK) { + if(mapSporks.count(inv.hash)) { CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); ss.reserve(1000); ss << mapSporks[inv.hash]; @@ -4529,10 +4520,8 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam } } - if (!pushed && inv.type == MSG_MASTERNODE_WINNER) - { - if(mnpayments.mapMasternodePayeeVotes.count(inv.hash)) - { + if (!pushed && inv.type == MSG_MASTERNODE_WINNER) { + if(mnpayments.mapMasternodePayeeVotes.count(inv.hash)) { CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); ss.reserve(1000); ss << mnpayments.mapMasternodePayeeVotes[inv.hash]; @@ -4541,10 +4530,8 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam } } - if (!pushed && inv.type == MSG_GOVERNANCE_VOTE) - { - if(governance.mapVotesByHash.count(inv.hash)) - { + if (!pushed && inv.type == MSG_GOVERNANCE_VOTE) { + if(governance.mapVotesByHash.count(inv.hash)) { CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); ss.reserve(1000); ss << governance.mapVotesByHash[inv.hash]; @@ -4553,10 +4540,8 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam } } - if (!pushed && inv.type == MSG_GOVERNANCE_OBJECT) - { - if(governance.mapObjects.count(inv.hash)) - { + if (!pushed && inv.type == MSG_GOVERNANCE_OBJECT) { + if(governance.mapObjects.count(inv.hash)) { CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); ss.reserve(1000); ss << governance.mapObjects[inv.hash]; @@ -4575,10 +4560,8 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam } } - if (!pushed && inv.type == MSG_MASTERNODE_PING) - { - if(mnodeman.mapSeenMasternodePing.count(inv.hash)) - { + if (!pushed && inv.type == MSG_MASTERNODE_PING) { + if(mnodeman.mapSeenMasternodePing.count(inv.hash)) { CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); ss.reserve(1000); ss << mnodeman.mapSeenMasternodePing[inv.hash]; @@ -4587,10 +4570,8 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam } } - if (!pushed && inv.type == MSG_DSTX) - { - if(mapDarksendBroadcastTxes.count(inv.hash)) - { + if (!pushed && inv.type == MSG_DSTX) { + if(mapDarksendBroadcastTxes.count(inv.hash)) { CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); ss.reserve(1000); ss << @@ -6119,9 +6100,7 @@ bool SendMessages(CNode* pto) pto->mapAskFor.erase(pto->mapAskFor.begin()); } if (!vGetData.empty()) - { pto->PushMessage(NetMsgType::GETDATA, vGetData); - } } return true;