Skip to content

Commit

Permalink
Verify if founder fee added in ConnectBlock()
Browse files Browse the repository at this point in the history
  • Loading branch information
cdonnachie authored and alamshafil committed Sep 9, 2022
1 parent 312fa44 commit 98449bf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2821,6 +2821,11 @@ static bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockInd
block.vtx[0]->GetValueOut(AreEnforcedValuesDeployed()), blockReward),
REJECT_INVALID, "bad-cb-amount");

FounderPayment founderPayment = Params().GetConsensus().nFounderPayment;
if (!founderPayment.IsBlockPayeeValid(*block.vtx[0], pindex->nHeight, blockReward))
return state.DoS(0, error("ConnectBlock(): couldn't find founders fee payments"),
REJECT_INVALID, "bad-cb-payee");

if (!control.Wait())
return state.DoS(100, error("%s: CheckQueue failed", __func__), REJECT_INVALID, "block-validation-failed");
int64_t nTime4 = GetTimeMicros(); nTimeVerify += nTime4 - nTime2;
Expand Down

0 comments on commit 98449bf

Please sign in to comment.