Skip to content

Commit 191b087

Browse files
committed
Merge pull request #4109
6b29ccc Correct indentation (R E Broadley)
2 parents b2ee43f + 6b29ccc commit 191b087

File tree

1 file changed

+45
-44
lines changed

1 file changed

+45
-44
lines changed

src/main.cpp

Lines changed: 45 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -74,53 +74,54 @@ const string strMessageMagic = "Bitcoin Signed Message:\n";
7474

7575
// Internal stuff
7676
namespace {
77-
struct CBlockIndexWorkComparator
78-
{
79-
bool operator()(CBlockIndex *pa, CBlockIndex *pb) {
80-
// First sort by most total work, ...
81-
if (pa->nChainWork > pb->nChainWork) return false;
82-
if (pa->nChainWork < pb->nChainWork) return true;
77+
struct CBlockIndexWorkComparator
78+
{
79+
bool operator()(CBlockIndex *pa, CBlockIndex *pb) {
80+
// First sort by most total work, ...
81+
if (pa->nChainWork > pb->nChainWork) return false;
82+
if (pa->nChainWork < pb->nChainWork) return true;
8383

84-
// ... then by earliest time received, ...
85-
if (pa->nSequenceId < pb->nSequenceId) return false;
86-
if (pa->nSequenceId > pb->nSequenceId) return true;
84+
// ... then by earliest time received, ...
85+
if (pa->nSequenceId < pb->nSequenceId) return false;
86+
if (pa->nSequenceId > pb->nSequenceId) return true;
8787

88-
// Use pointer address as tie breaker (should only happen with blocks
89-
// loaded from disk, as those all have id 0).
90-
if (pa < pb) return false;
91-
if (pa > pb) return true;
88+
// Use pointer address as tie breaker (should only happen with blocks
89+
// loaded from disk, as those all have id 0).
90+
if (pa < pb) return false;
91+
if (pa > pb) return true;
9292

93-
// Identical blocks.
94-
return false;
95-
}
96-
};
97-
98-
CBlockIndex *pindexBestInvalid;
99-
set<CBlockIndex*, CBlockIndexWorkComparator> setBlockIndexValid; // may contain all CBlockIndex*'s that have validness >=BLOCK_VALID_TRANSACTIONS, and must contain those who aren't failed
100-
101-
CCriticalSection cs_LastBlockFile;
102-
CBlockFileInfo infoLastBlockFile;
103-
int nLastBlockFile = 0;
104-
105-
// Every received block is assigned a unique and increasing identifier, so we
106-
// know which one to give priority in case of a fork.
107-
CCriticalSection cs_nBlockSequenceId;
108-
// Blocks loaded from disk are assigned id 0, so start the counter at 1.
109-
uint32_t nBlockSequenceId = 1;
110-
111-
// Sources of received blocks, to be able to send them reject messages or ban
112-
// them, if processing happens afterwards. Protected by cs_main.
113-
map<uint256, NodeId> mapBlockSource;
114-
115-
// Blocks that are in flight, and that are in the queue to be downloaded.
116-
// Protected by cs_main.
117-
struct QueuedBlock {
118-
uint256 hash;
119-
int64_t nTime; // Time of "getdata" request in microseconds.
120-
int nQueuedBefore; // Number of blocks in flight at the time of request.
121-
};
122-
map<uint256, pair<NodeId, list<QueuedBlock>::iterator> > mapBlocksInFlight;
123-
map<uint256, pair<NodeId, list<uint256>::iterator> > mapBlocksToDownload;
93+
// Identical blocks.
94+
return false;
95+
}
96+
};
97+
98+
CBlockIndex *pindexBestInvalid;
99+
// may contain all CBlockIndex*'s that have validness >=BLOCK_VALID_TRANSACTIONS, and must contain those who aren't failed
100+
set<CBlockIndex*, CBlockIndexWorkComparator> setBlockIndexValid;
101+
102+
CCriticalSection cs_LastBlockFile;
103+
CBlockFileInfo infoLastBlockFile;
104+
int nLastBlockFile = 0;
105+
106+
// Every received block is assigned a unique and increasing identifier, so we
107+
// know which one to give priority in case of a fork.
108+
CCriticalSection cs_nBlockSequenceId;
109+
// Blocks loaded from disk are assigned id 0, so start the counter at 1.
110+
uint32_t nBlockSequenceId = 1;
111+
112+
// Sources of received blocks, to be able to send them reject messages or ban
113+
// them, if processing happens afterwards. Protected by cs_main.
114+
map<uint256, NodeId> mapBlockSource;
115+
116+
// Blocks that are in flight, and that are in the queue to be downloaded.
117+
// Protected by cs_main.
118+
struct QueuedBlock {
119+
uint256 hash;
120+
int64_t nTime; // Time of "getdata" request in microseconds.
121+
int nQueuedBefore; // Number of blocks in flight at the time of request.
122+
};
123+
map<uint256, pair<NodeId, list<QueuedBlock>::iterator> > mapBlocksInFlight;
124+
map<uint256, pair<NodeId, list<uint256>::iterator> > mapBlocksToDownload;
124125
}
125126

126127
//////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)