Fix block value/payee validation in lite mode (#2148)
This commit is contained in:
parent
7ab5b4a28e
commit
26c891f67f
@ -80,10 +80,10 @@ bool IsBlockValueValid(const CBlock& block, int nBlockHeight, CAmount blockRewar
|
||||
|
||||
LogPrint("gobject", "block.vtx[0]->GetValueOut() %lld <= nSuperblockMaxValue %lld\n", block.vtx[0]->GetValueOut(), nSuperblockMaxValue);
|
||||
|
||||
if(!masternodeSync.IsSynced()) {
|
||||
if(!masternodeSync.IsSynced() || fLiteMode) {
|
||||
// not enough data but at least it must NOT exceed superblock max value
|
||||
if(CSuperblock::IsValidBlockHeight(nBlockHeight)) {
|
||||
if(fDebug) LogPrintf("IsBlockPayeeValid -- WARNING: Client not synced, checking superblock max bounds only\n");
|
||||
if(fDebug) LogPrintf("IsBlockPayeeValid -- WARNING: Not enough data, checking superblock max bounds only\n");
|
||||
if(!isSuperblockMaxValueMet) {
|
||||
strErrorRet = strprintf("coinbase pays too much at height %d (actual=%d vs limit=%d), exceeded superblock max value",
|
||||
nBlockHeight, block.vtx[0]->GetValueOut(), nSuperblockMaxValue);
|
||||
@ -134,9 +134,9 @@ bool IsBlockValueValid(const CBlock& block, int nBlockHeight, CAmount blockRewar
|
||||
|
||||
bool IsBlockPayeeValid(const CTransaction& txNew, int nBlockHeight, CAmount blockReward)
|
||||
{
|
||||
if(!masternodeSync.IsSynced()) {
|
||||
if(!masternodeSync.IsSynced() || fLiteMode) {
|
||||
//there is no budget data to use to check anything, let's just accept the longest chain
|
||||
if(fDebug) LogPrintf("IsBlockPayeeValid -- WARNING: Client not synced, skipping block payee checks\n");
|
||||
if(fDebug) LogPrintf("IsBlockPayeeValid -- WARNING: Not enough data, skipping block payee checks\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user