Skip to content

Commit e0315b3

Browse files
celbalraickti
authored andcommitted
Disable generatetoaddress during POS
1 parent a0100c3 commit e0315b3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/rpc/mining.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ UniValue generatetoaddress(const JSONRPCRequest& request)
181181
+ HelpExampleCli("generatetoaddress", "11 \"myaddress\"")
182182
);
183183

184+
if (chainActive.Tip()->nHeight + 1 >= Params().GetConsensus().nPosStartHeight) {
185+
throw JSONRPCError(RPC_INVALID_PARAMETER, "Unable to call generatetoaddress in the Proof-of-Stake phase");
186+
}
187+
184188
int nGenerate = request.params[0].get_int();
185189
uint64_t nMaxTries = 1000000;
186190
if (!request.params[2].isNull()) {

0 commit comments

Comments
 (0)