Skip to content

Commit 4ed2315

Browse files
committed
Merge pull request #4457
834e46e CBlockIndex()::SetNull() method to avoid code repetition (jtimon)
2 parents e1f7c7d + 834e46e commit 4ed2315

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

src/main.h

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ class CBlockIndex
712712
// (memory only) Sequencial id assigned to distinguish order in which blocks are received.
713713
uint32_t nSequenceId;
714714

715-
CBlockIndex()
715+
void SetNull()
716716
{
717717
phashBlock = NULL;
718718
pprev = NULL;
@@ -734,20 +734,14 @@ class CBlockIndex
734734
nNonce = 0;
735735
}
736736

737+
CBlockIndex()
738+
{
739+
SetNull();
740+
}
741+
737742
CBlockIndex(CBlockHeader& block)
738743
{
739-
phashBlock = NULL;
740-
pprev = NULL;
741-
pskip = NULL;
742-
nHeight = 0;
743-
nFile = 0;
744-
nDataPos = 0;
745-
nUndoPos = 0;
746-
nChainWork = 0;
747-
nTx = 0;
748-
nChainTx = 0;
749-
nStatus = 0;
750-
nSequenceId = 0;
744+
SetNull();
751745

752746
nVersion = block.nVersion;
753747
hashMerkleRoot = block.hashMerkleRoot;

0 commit comments

Comments
 (0)