Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 3,906 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 1 || | ||||
}, | }, | ||||
RPCResult{ | RPCResult{ | ||||
"[ blockhashes ] (array) hashes of blocks generated\n"}, | "[ blockhashes ] (array) hashes of blocks generated\n"}, | ||||
RPCExamples{"\nGenerate 11 blocks\n" + | RPCExamples{"\nGenerate 11 blocks\n" + | ||||
HelpExampleCli("generate", "11")}} | HelpExampleCli("generate", "11")}} | ||||
.ToString()); | .ToString()); | ||||
} | } | ||||
if (!IsDeprecatedRPCEnabled(gArgs, "generate")) { | |||||
throw JSONRPCError(RPC_METHOD_DEPRECATED, | |||||
"The wallet generate rpc method is deprecated and " | |||||
"will be fully removed in v0.19. " | |||||
"To use generate in v0.18, restart bitcoind with " | |||||
"-deprecatedrpc=generate.\n" | |||||
"Clients should transition to using the node rpc " | |||||
"method generatetoaddress\n"); | |||||
} | |||||
int num_generate = request.params[0].get_int(); | int num_generate = request.params[0].get_int(); | ||||
uint64_t max_tries = 1000000; | uint64_t max_tries = 1000000; | ||||
if (!request.params[1].isNull()) { | if (!request.params[1].isNull()) { | ||||
max_tries = request.params[1].get_int(); | max_tries = request.params[1].get_int(); | ||||
} | } | ||||
std::shared_ptr<CReserveScript> coinbase_script; | std::shared_ptr<CReserveScript> coinbase_script; | ||||
pwallet->GetScriptForMining(coinbase_script); | pwallet->GetScriptForMining(coinbase_script); | ||||
▲ Show 20 Lines • Show All 955 Lines • Show Last 20 Lines |