Skip to content

Commit

Permalink
Block consolidating rewards after static rewards
Browse files Browse the repository at this point in the history
  • Loading branch information
Bushstar committed Oct 21, 2024
1 parent 3ed6eb5 commit bb0a0bb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2253,6 +2253,9 @@ bool AppInitMain(InitInterfaces& interfaces)
}

if (gArgs.IsArgSet("-consolidaterewards")) {
if (::ChainActive().Height() >= chainparams.GetConsensus().DF24Height) {
return InitError("Consolidate rewards is not available after static rewards are active.\n");
}
const std::vector<std::string> tokenSymbolArgs = gArgs.GetArgs("-consolidaterewards");
auto fullRewardConsolidation = false;
for (const auto &tokenSymbolInput : tokenSymbolArgs) {
Expand Down Expand Up @@ -2296,6 +2299,7 @@ bool AppInitMain(InitInterfaces& interfaces)
ConsolidateRewards(*pcustomcsview, ::ChainActive().Height(), ownersToConsolidate, true);
}
pcustomcsview->Flush();
pcustomcsDB->Flush();
}

// ********************************************************* Step 12: import blocks
Expand Down

0 comments on commit bb0a0bb

Please sign in to comment.