Skip to content

Commit bde4872

Browse files
committed
[Budget] Add log for removed budget proposals
1 parent 6a1de07 commit bde4872

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/masternode-budget.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,10 @@ void CBudgetManager::CheckAndRemove()
439439
while (it2 != mapProposals.end()) {
440440
CBudgetProposal* pbudgetProposal = &((*it2).second);
441441
pbudgetProposal->fValid = pbudgetProposal->IsValid(strError);
442+
if (!strError.empty ()) {
443+
LogPrintf("CBudgetManager::CheckAndRemove - invalid budget proposal - %s\n", strError);
444+
strError = "";
445+
}
442446
++it2;
443447
}
444448

@@ -1364,7 +1368,7 @@ bool CBudgetProposal::IsValid(std::string& strError, bool fCheckCollateral)
13641368
}
13651369

13661370
if (nBlockEnd < nBlockStart) {
1367-
strError = "Invalid nBlockEnd";
1371+
strError = "Invalid nBlockEnd (end before start)";
13681372
return false;
13691373
}
13701374

@@ -1381,6 +1385,7 @@ bool CBudgetProposal::IsValid(std::string& strError, bool fCheckCollateral)
13811385
if (fCheckCollateral) {
13821386
int nConf = 0;
13831387
if (!IsBudgetCollateralValid(nFeeTXHash, GetHash(), strError, nTime, nConf)) {
1388+
strError = "Invalid collateral";
13841389
return false;
13851390
}
13861391
}
@@ -1415,8 +1420,10 @@ bool CBudgetProposal::IsValid(std::string& strError, bool fCheckCollateral)
14151420
return true;
14161421
}
14171422

1418-
if (GetBlockEnd() < pindexPrev->nHeight - GetBudgetPaymentCycleBlocks() / 2) return false;
1419-
1423+
if (GetBlockEnd() < pindexPrev->nHeight - GetBudgetPaymentCycleBlocks() / 2) {
1424+
strError = "Invalid nBlockEnd (end too early)";
1425+
return false;
1426+
}
14201427

14211428
return true;
14221429
}

0 commit comments

Comments
 (0)