Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/mining.cpp
| Show First 20 Lines • Show All 200 Lines • ▼ Show 20 Lines | static UniValue generatetoaddress(const Config &config, | ||||
| int nGenerate = request.params[0].get_int(); | int nGenerate = request.params[0].get_int(); | ||||
| uint64_t nMaxTries = 1000000; | uint64_t nMaxTries = 1000000; | ||||
| if (request.params.size() > 2) { | if (request.params.size() > 2) { | ||||
| nMaxTries = request.params[2].get_int(); | nMaxTries = request.params[2].get_int(); | ||||
| } | } | ||||
| CTxDestination destination = | CTxDestination destination = | ||||
| DecodeDestination(request.params[1].get_str(), config.GetChainParams()); | DecodeDestination(request.params[1].get_str(), config); | ||||
| if (!IsValidDestination(destination)) { | if (!IsValidDestination(destination)) { | ||||
| throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, | throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, | ||||
| "Error: Invalid address"); | "Error: Invalid address"); | ||||
| } | } | ||||
| std::shared_ptr<CReserveScript> coinbaseScript = | std::shared_ptr<CReserveScript> coinbaseScript = | ||||
| std::make_shared<CReserveScript>(); | std::make_shared<CReserveScript>(); | ||||
| coinbaseScript->reserveScript = GetScriptForDestination(destination); | coinbaseScript->reserveScript = GetScriptForDestination(destination); | ||||
| ▲ Show 20 Lines • Show All 729 Lines • Show Last 20 Lines | |||||