fix curly braces

This commit is contained in:
Evan Duffield 2016-06-06 16:55:16 -07:00
parent 15821fe2d4
commit aa8fdd76aa
2 changed files with 22 additions and 46 deletions

View File

@ -452,8 +452,7 @@ void CGovernanceManager::Sync(CNode* pfrom, uint256 nProp)
// SYNC GOVERNANCE OBJECTS WITH OTHER CLIENT // SYNC GOVERNANCE OBJECTS WITH OTHER CLIENT
std::map<uint256, CGovernanceObject>::iterator it1 = mapObjects.begin(); std::map<uint256, CGovernanceObject>::iterator it1 = mapObjects.begin();
while(it1 != mapObjects.end()) while(it1 != mapObjects.end()) {
{
uint256 h = (*it1).first; uint256 h = (*it1).first;
if((*it1).second.fCachedValid && ((nProp == uint256() || (h == nProp)))){ 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 // SYNC OUR GOVERNANCE OBJECT VOTES WITH THEIR GOVERNANCE OBJECT VOTES
std::map<uint256, CGovernanceVote>::iterator it2 = mapVotesByHash.begin(); std::map<uint256, CGovernanceVote>::iterator it2 = mapVotesByHash.begin();
while(it2 != mapVotesByHash.end()) while(it2 != mapVotesByHash.end()) {
{
pfrom->PushInventory(CInv(MSG_GOVERNANCE_VOTE, (*it2).first)); pfrom->PushInventory(CInv(MSG_GOVERNANCE_VOTE, (*it2).first));
nInvCount++; nInvCount++;
++it2; ++it2;
@ -518,8 +516,7 @@ bool CGovernanceManager::AddOrUpdateVote(const CGovernanceVote& vote, std::strin
uint256 nTypeHash = vote.GetTypeHash(); uint256 nTypeHash = vote.GetTypeHash();
uint256 nHash = vote.GetHash(); uint256 nHash = vote.GetHash();
if(mapVotesByType.count(nTypeHash)) if(mapVotesByType.count(nTypeHash)) {
{
if(mapVotesByType[nTypeHash].nTime > vote.nTime){ if(mapVotesByType[nTypeHash].nTime > vote.nTime){
strError = strprintf("new vote older than existing vote - %s", nTypeHash.ToString()); strError = strprintf("new vote older than existing vote - %s", nTypeHash.ToString());
LogPrint("mngovernance", "CGovernanceObject::AddOrUpdateVote - %s\n", strError); LogPrint("mngovernance", "CGovernanceObject::AddOrUpdateVote - %s\n", strError);

View File

@ -4425,8 +4425,7 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
} }
// Pruned nodes may have deleted the block, so check whether // Pruned nodes may have deleted the block, so check whether
// it's available before trying to send. // 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 // Send block from disk
CBlock block; CBlock block;
if (!ReadBlockFromDisk(block, (*mi).second, consensusParams)) 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; CTransaction tx;
if (mempool.lookup(inv.hash, tx)) if (mempool.lookup(inv.hash, tx)) {
{
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
ss.reserve(1000); ss.reserve(1000);
ss << tx; ss << tx;
@ -4493,10 +4490,8 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
} }
} }
if (!pushed && inv.type == MSG_TXLOCK_VOTE) if (!pushed && inv.type == MSG_TXLOCK_VOTE) {
{ if(mapTxLockVote.count(inv.hash)) {
if(mapTxLockVote.count(inv.hash))
{
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
ss.reserve(1000); ss.reserve(1000);
ss << mapTxLockVote[inv.hash]; 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 (!pushed && inv.type == MSG_TXLOCK_REQUEST) {
{ if(mapTxLockReq.count(inv.hash)) {
if(mapTxLockReq.count(inv.hash))
{
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
ss.reserve(1000); ss.reserve(1000);
ss << mapTxLockReq[inv.hash]; ss << mapTxLockReq[inv.hash];
@ -4517,10 +4510,8 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
} }
} }
if (!pushed && inv.type == MSG_SPORK) if (!pushed && inv.type == MSG_SPORK) {
{ if(mapSporks.count(inv.hash)) {
if(mapSporks.count(inv.hash))
{
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
ss.reserve(1000); ss.reserve(1000);
ss << mapSporks[inv.hash]; 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 (!pushed && inv.type == MSG_MASTERNODE_WINNER) {
{ if(mnpayments.mapMasternodePayeeVotes.count(inv.hash)) {
if(mnpayments.mapMasternodePayeeVotes.count(inv.hash))
{
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
ss.reserve(1000); ss.reserve(1000);
ss << mnpayments.mapMasternodePayeeVotes[inv.hash]; 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 (!pushed && inv.type == MSG_GOVERNANCE_VOTE) {
{ if(governance.mapVotesByHash.count(inv.hash)) {
if(governance.mapVotesByHash.count(inv.hash))
{
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
ss.reserve(1000); ss.reserve(1000);
ss << governance.mapVotesByHash[inv.hash]; 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 (!pushed && inv.type == MSG_GOVERNANCE_OBJECT) {
{ if(governance.mapObjects.count(inv.hash)) {
if(governance.mapObjects.count(inv.hash))
{
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
ss.reserve(1000); ss.reserve(1000);
ss << governance.mapObjects[inv.hash]; 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 (!pushed && inv.type == MSG_MASTERNODE_PING) {
{ if(mnodeman.mapSeenMasternodePing.count(inv.hash)) {
if(mnodeman.mapSeenMasternodePing.count(inv.hash))
{
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
ss.reserve(1000); ss.reserve(1000);
ss << mnodeman.mapSeenMasternodePing[inv.hash]; 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 (!pushed && inv.type == MSG_DSTX) {
{ if(mapDarksendBroadcastTxes.count(inv.hash)) {
if(mapDarksendBroadcastTxes.count(inv.hash))
{
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
ss.reserve(1000); ss.reserve(1000);
ss << ss <<
@ -6119,9 +6100,7 @@ bool SendMessages(CNode* pto)
pto->mapAskFor.erase(pto->mapAskFor.begin()); pto->mapAskFor.erase(pto->mapAskFor.begin());
} }
if (!vGetData.empty()) if (!vGetData.empty())
{
pto->PushMessage(NetMsgType::GETDATA, vGetData); pto->PushMessage(NetMsgType::GETDATA, vGetData);
}
} }
return true; return true;