Skip to content

Commit

Permalink
Disable generatetoaddress during POS
Browse files Browse the repository at this point in the history
  • Loading branch information
celbalrai authored and ckti committed Apr 10, 2022
1 parent 2b214f4 commit 09552cd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ UniValue generatetoaddress(const JSONRPCRequest& request)
+ HelpExampleCli("generatetoaddress", "11 \"myaddress\"")
);

if (chainActive.Tip()->nHeight + 1 >= Params().GetConsensus().nPosStartHeight) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Unable to call generatetoaddress in the Proof-of-Stake phase");
}

int nGenerate = request.params[0].get_int();
uint64_t nMaxTries = 1000000;
if (!request.params[2].isNull()) {
Expand Down

0 comments on commit 09552cd

Please sign in to comment.