Merge #10780: Simplify "!foo || (foo && bar)" as "!foo || bar"

1e3a3200a Simplify "!foo || (foo && bar)" as "!foo || bar" (practicalswift)

Tree-SHA512: d5ce6d7a9f3741e7abe8542b840268aa683e276aac7587041d32385a4c1273e20c236bec7590e27540dde72defb3f879d4695822bb7bfdb092cc20d9aefa64c1
This commit is contained in:
Pieter Wuille 2017-07-12 18:23:30 -07:00 committed by Pasta
parent 526036ead8
commit 09854d6613
No known key found for this signature in database
GPG Key ID: D362C9F7142766AE

View File

@ -1314,7 +1314,7 @@ static void CheckForkWarningConditionsOnNewFork(CBlockIndex* pindexNewForkTip)
// hash rate operating on the fork.
// We define it this way because it allows us to only store the highest fork tip (+ base) which meets
// the 7-block condition and from this always have the most-likely-to-cause-warning fork
if (pfork && (!pindexBestForkTip || (pindexBestForkTip && pindexNewForkTip->nHeight > pindexBestForkTip->nHeight)) &&
if (pfork && (!pindexBestForkTip || pindexNewForkTip->nHeight > pindexBestForkTip->nHeight) &&
pindexNewForkTip->nChainWork - pfork->nChainWork > (GetBlockProof(*pfork) * 7) &&
chainActive.Height() - pindexNewForkTip->nHeight < 72)
{