Skip to content

Commit 1e3a320

Browse files
Simplify "!foo || (foo && bar)" as "!foo || bar"
1 parent 1d4805c commit 1e3a320

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/validation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,7 @@ static void CheckForkWarningConditionsOnNewFork(CBlockIndex* pindexNewForkTip)
11411141
// or a chain that is entirely longer than ours and invalid (note that this should be detected by both)
11421142
// We define it this way because it allows us to only store the highest fork tip (+ base) which meets
11431143
// the 7-block condition and from this always have the most-likely-to-cause-warning fork
1144-
if (pfork && (!pindexBestForkTip || (pindexBestForkTip && pindexNewForkTip->nHeight > pindexBestForkTip->nHeight)) &&
1144+
if (pfork && (!pindexBestForkTip || pindexNewForkTip->nHeight > pindexBestForkTip->nHeight) &&
11451145
pindexNewForkTip->nChainWork - pfork->nChainWork > (GetBlockProof(*pfork) * 7) &&
11461146
chainActive.Height() - pindexNewForkTip->nHeight < 72)
11471147
{

0 commit comments

Comments
 (0)