aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjtimon <[email protected]>2014-07-02 18:36:43 +0200
committerjtimon <[email protected]>2014-07-02 18:36:43 +0200
commit834e46e847188df513b8b57ab30fe9940f2b2dd0 (patch)
treed7310ccdd8c71b05035299ce1f6de2315e347e55 /src
parentqt: fix 'opens in testnet mode when presented with a BIP-72 link with no fall... (diff)
downloaddiscoin-834e46e847188df513b8b57ab30fe9940f2b2dd0.tar.xz
discoin-834e46e847188df513b8b57ab30fe9940f2b2dd0.zip
CBlockIndex()::SetNull() method to avoid code repetition
Diffstat (limited to 'src')
-rw-r--r--src/main.h20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/main.h b/src/main.h
index 19f446900..cc7dea75a 100644
--- a/src/main.h
+++ b/src/main.h
@@ -718,7 +718,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;
@@ -740,20 +740,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;