From 6b29ccc9f9a166b54a9a0a026debe6244b77d805 Mon Sep 17 00:00:00 2001 From: R E Broadley Date: Wed, 30 Apr 2014 14:57:11 +0800 Subject: [PATCH] Correct indentation --- src/main.cpp | 89 ++++++++++++++++++++++++++-------------------------- 1 file changed, 45 insertions(+), 44 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 7a6d4b39d..dc584416e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -74,53 +74,54 @@ const string strMessageMagic = "Bitcoin Signed Message:\n"; // Internal stuff namespace { -struct CBlockIndexWorkComparator -{ - bool operator()(CBlockIndex *pa, CBlockIndex *pb) { - // First sort by most total work, ... - if (pa->nChainWork > pb->nChainWork) return false; - if (pa->nChainWork < pb->nChainWork) return true; + struct CBlockIndexWorkComparator + { + bool operator()(CBlockIndex *pa, CBlockIndex *pb) { + // First sort by most total work, ... + if (pa->nChainWork > pb->nChainWork) return false; + if (pa->nChainWork < pb->nChainWork) return true; - // ... then by earliest time received, ... - if (pa->nSequenceId < pb->nSequenceId) return false; - if (pa->nSequenceId > pb->nSequenceId) return true; + // ... then by earliest time received, ... + if (pa->nSequenceId < pb->nSequenceId) return false; + if (pa->nSequenceId > pb->nSequenceId) return true; - // Use pointer address as tie breaker (should only happen with blocks - // loaded from disk, as those all have id 0). - if (pa < pb) return false; - if (pa > pb) return true; + // Use pointer address as tie breaker (should only happen with blocks + // loaded from disk, as those all have id 0). + if (pa < pb) return false; + if (pa > pb) return true; - // Identical blocks. - return false; - } -}; - -CBlockIndex *pindexBestInvalid; -set setBlockIndexValid; // may contain all CBlockIndex*'s that have validness >=BLOCK_VALID_TRANSACTIONS, and must contain those who aren't failed - -CCriticalSection cs_LastBlockFile; -CBlockFileInfo infoLastBlockFile; -int nLastBlockFile = 0; - -// Every received block is assigned a unique and increasing identifier, so we -// know which one to give priority in case of a fork. -CCriticalSection cs_nBlockSequenceId; -// Blocks loaded from disk are assigned id 0, so start the counter at 1. -uint32_t nBlockSequenceId = 1; - -// Sources of received blocks, to be able to send them reject messages or ban -// them, if processing happens afterwards. Protected by cs_main. -map mapBlockSource; - -// Blocks that are in flight, and that are in the queue to be downloaded. -// Protected by cs_main. -struct QueuedBlock { - uint256 hash; - int64_t nTime; // Time of "getdata" request in microseconds. - int nQueuedBefore; // Number of blocks in flight at the time of request. -}; -map::iterator> > mapBlocksInFlight; -map::iterator> > mapBlocksToDownload; + // Identical blocks. + return false; + } + }; + + CBlockIndex *pindexBestInvalid; + // may contain all CBlockIndex*'s that have validness >=BLOCK_VALID_TRANSACTIONS, and must contain those who aren't failed + set setBlockIndexValid; + + CCriticalSection cs_LastBlockFile; + CBlockFileInfo infoLastBlockFile; + int nLastBlockFile = 0; + + // Every received block is assigned a unique and increasing identifier, so we + // know which one to give priority in case of a fork. + CCriticalSection cs_nBlockSequenceId; + // Blocks loaded from disk are assigned id 0, so start the counter at 1. + uint32_t nBlockSequenceId = 1; + + // Sources of received blocks, to be able to send them reject messages or ban + // them, if processing happens afterwards. Protected by cs_main. + map mapBlockSource; + + // Blocks that are in flight, and that are in the queue to be downloaded. + // Protected by cs_main. + struct QueuedBlock { + uint256 hash; + int64_t nTime; // Time of "getdata" request in microseconds. + int nQueuedBefore; // Number of blocks in flight at the time of request. + }; + map::iterator> > mapBlocksInFlight; + map::iterator> > mapBlocksToDownload; } //////////////////////////////////////////////////////////////////////////////