diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-07-07 07:44:22 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-07-07 07:44:48 +0200 |
commit | 4ed2315e86621cf547fbc3649fcbe39c793a7eb3 (patch) | |
tree | babe222b3831d1558c18df1191a703bba1fd55a5 /src/main.h | |
parent | e1f7c7d173a7522673f4638a6125ac43e78d1258 (diff) | |
parent | 834e46e847188df513b8b57ab30fe9940f2b2dd0 (diff) |
Merge pull request #4457
834e46e CBlockIndex()::SetNull() method to avoid code repetition (jtimon)
Diffstat (limited to 'src/main.h')
-rw-r--r-- | src/main.h | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/main.h b/src/main.h index 33b00a7b50..f6bac889be 100644 --- a/src/main.h +++ b/src/main.h @@ -712,7 +712,7 @@ public: // (memory only) Sequencial id assigned to distinguish order in which blocks are received. uint32_t nSequenceId; - CBlockIndex() + void SetNull() { phashBlock = NULL; pprev = NULL; @@ -734,20 +734,14 @@ public: nNonce = 0; } + CBlockIndex() + { + SetNull(); + } + CBlockIndex(CBlockHeader& block) { - phashBlock = NULL; - pprev = NULL; - pskip = NULL; - nHeight = 0; - nFile = 0; - nDataPos = 0; - nUndoPos = 0; - nChainWork = 0; - nTx = 0; - nChainTx = 0; - nStatus = 0; - nSequenceId = 0; + SetNull(); nVersion = block.nVersion; hashMerkleRoot = block.hashMerkleRoot; |