|
19 | 19 | #include <policy/fees.h>
|
20 | 20 | #include <policy/policy.h>
|
21 | 21 | #include <policy/rbf.h>
|
22 |
| -#include <rpc/mining.h> |
23 | 22 | #include <rpc/rawtransaction.h>
|
24 | 23 | #include <rpc/server.h>
|
25 | 24 | #include <rpc/util.h>
|
@@ -3358,62 +3357,6 @@ static UniValue bumpfee(const JSONRPCRequest& request)
|
3358 | 3357 | return result;
|
3359 | 3358 | }
|
3360 | 3359 |
|
3361 |
| -UniValue generate(const JSONRPCRequest& request) |
3362 |
| -{ |
3363 |
| - std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); |
3364 |
| - CWallet* const pwallet = wallet.get(); |
3365 |
| - |
3366 |
| - |
3367 |
| - if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { |
3368 |
| - return NullUniValue; |
3369 |
| - } |
3370 |
| - |
3371 |
| - if (request.fHelp || request.params.size() < 1 || request.params.size() > 2) { |
3372 |
| - throw std::runtime_error( |
3373 |
| - RPCHelpMan{"generate", |
3374 |
| - "\nMine up to nblocks blocks immediately (before the RPC call returns) to an address in the wallet.\n", |
3375 |
| - { |
3376 |
| - {"nblocks", RPCArg::Type::NUM, RPCArg::Optional::NO, "How many blocks are generated immediately."}, |
3377 |
| - {"maxtries", RPCArg::Type::NUM, /* default */ "1000000", "How many iterations to try."}, |
3378 |
| - }, |
3379 |
| - RPCResult{ |
3380 |
| - "[ blockhashes ] (array) hashes of blocks generated\n" |
3381 |
| - }, |
3382 |
| - RPCExamples{ |
3383 |
| - "\nGenerate 11 blocks\n" |
3384 |
| - + HelpExampleCli("generate", "11") |
3385 |
| - }, |
3386 |
| - }.ToString()); |
3387 |
| - } |
3388 |
| - |
3389 |
| - if (!IsDeprecatedRPCEnabled("generate")) { |
3390 |
| - throw JSONRPCError(RPC_METHOD_DEPRECATED, "The wallet generate rpc method is deprecated and will be fully removed in v0.19. " |
3391 |
| - "To use generate in v0.18, restart bitcoind with -deprecatedrpc=generate.\n" |
3392 |
| - "Clients should transition to using the node rpc method generatetoaddress\n"); |
3393 |
| - } |
3394 |
| - |
3395 |
| - int num_generate = request.params[0].get_int(); |
3396 |
| - uint64_t max_tries = 1000000; |
3397 |
| - if (!request.params[1].isNull()) { |
3398 |
| - max_tries = request.params[1].get_int(); |
3399 |
| - } |
3400 |
| - |
3401 |
| - std::shared_ptr<CReserveScript> coinbase_script; |
3402 |
| - pwallet->GetScriptForMining(coinbase_script); |
3403 |
| - |
3404 |
| - // If the keypool is exhausted, no script is returned at all. Catch this. |
3405 |
| - if (!coinbase_script) { |
3406 |
| - throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, "Error: Keypool ran out, please call keypoolrefill first"); |
3407 |
| - } |
3408 |
| - |
3409 |
| - //throw an error if no script was provided |
3410 |
| - if (coinbase_script->reserveScript.empty()) { |
3411 |
| - throw JSONRPCError(RPC_INTERNAL_ERROR, "No coinbase script available"); |
3412 |
| - } |
3413 |
| - |
3414 |
| - return generateBlocks(coinbase_script, num_generate, max_tries, true); |
3415 |
| -} |
3416 |
| - |
3417 | 3360 | UniValue rescanblockchain(const JSONRPCRequest& request)
|
3418 | 3361 | {
|
3419 | 3362 | std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request);
|
@@ -4156,7 +4099,6 @@ UniValue importmulti(const JSONRPCRequest& request);
|
4156 | 4099 | static const CRPCCommand commands[] =
|
4157 | 4100 | { // category name actor (function) argNames
|
4158 | 4101 | // --------------------- ------------------------ ----------------------- ----------
|
4159 |
| - { "generating", "generate", &generate, {"nblocks","maxtries"} }, |
4160 | 4102 | { "hidden", "resendwallettransactions", &resendwallettransactions, {} },
|
4161 | 4103 | { "rawtransactions", "fundrawtransaction", &fundrawtransaction, {"hexstring","options","iswitness"} },
|
4162 | 4104 | { "wallet", "abandontransaction", &abandontransaction, {"txid"} },
|
|
0 commit comments