Fix IsBlockPayeeValid (#2577)

- should skip while not synced regardless of spork15 state
- add missing logprintf
This commit is contained in:
UdjinM6 2018-12-21 18:21:28 +03:00 committed by GitHub
parent 03a6865d94
commit 587911b36f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -167,7 +167,7 @@ bool IsBlockValueValid(const CBlock& block, int nBlockHeight, CAmount blockRewar
bool IsBlockPayeeValid(const CTransaction& txNew, int nBlockHeight, CAmount blockReward)
{
if((!masternodeSync.IsSynced() && !deterministicMNManager->IsDeterministicMNsSporkActive(nBlockHeight)) || fLiteMode) {
if(!masternodeSync.IsSynced() || fLiteMode) {
//there is no budget data to use to check anything, let's just accept the longest chain
if(fDebug) LogPrintf("%s -- WARNING: Not enough data, skipping block payee checks\n", __func__);
return true;
@ -218,6 +218,7 @@ bool IsBlockPayeeValid(const CTransaction& txNew, int nBlockHeight, CAmount bloc
if (deterministicMNManager->IsDeterministicMNsSporkActive(nBlockHeight)) {
// always enforce masternode payments when spork15 is active
LogPrintf("%s -- ERROR: Invalid masternode payment detected at height %d: %s", __func__, nBlockHeight, txNew.ToString());
return false;
} else {
if(sporkManager.IsSporkActive(SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT)) {