Skip to content

Commit 26c891f

Browse files
authored
Fix block value/payee validation in lite mode (#2148)
1 parent 7ab5b4a commit 26c891f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/masternode-payments.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ bool IsBlockValueValid(const CBlock& block, int nBlockHeight, CAmount blockRewar
8080

8181
LogPrint("gobject", "block.vtx[0]->GetValueOut() %lld <= nSuperblockMaxValue %lld\n", block.vtx[0]->GetValueOut(), nSuperblockMaxValue);
8282

83-
if(!masternodeSync.IsSynced()) {
83+
if(!masternodeSync.IsSynced() || fLiteMode) {
8484
// not enough data but at least it must NOT exceed superblock max value
8585
if(CSuperblock::IsValidBlockHeight(nBlockHeight)) {
86-
if(fDebug) LogPrintf("IsBlockPayeeValid -- WARNING: Client not synced, checking superblock max bounds only\n");
86+
if(fDebug) LogPrintf("IsBlockPayeeValid -- WARNING: Not enough data, checking superblock max bounds only\n");
8787
if(!isSuperblockMaxValueMet) {
8888
strErrorRet = strprintf("coinbase pays too much at height %d (actual=%d vs limit=%d), exceeded superblock max value",
8989
nBlockHeight, block.vtx[0]->GetValueOut(), nSuperblockMaxValue);
@@ -134,9 +134,9 @@ bool IsBlockValueValid(const CBlock& block, int nBlockHeight, CAmount blockRewar
134134

135135
bool IsBlockPayeeValid(const CTransaction& txNew, int nBlockHeight, CAmount blockReward)
136136
{
137-
if(!masternodeSync.IsSynced()) {
137+
if(!masternodeSync.IsSynced() || fLiteMode) {
138138
//there is no budget data to use to check anything, let's just accept the longest chain
139-
if(fDebug) LogPrintf("IsBlockPayeeValid -- WARNING: Client not synced, skipping block payee checks\n");
139+
if(fDebug) LogPrintf("IsBlockPayeeValid -- WARNING: Not enough data, skipping block payee checks\n");
140140
return true;
141141
}
142142

0 commit comments

Comments
 (0)