Skip to content

Commit 47a4da6

Browse files
UdjinM6CryptoCentric
authored andcommitted
Fix block value/payee validation in lite mode (dashpay#2148)
1 parent 81d0c0b commit 47a4da6

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
@@ -81,10 +81,10 @@ bool IsBlockValueValid(const CBlock& block, int nBlockHeight, CAmount blockRewar
8181

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

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

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

0 commit comments

Comments
 (0)