generatetoaddress
RPC can only generate to scriptPubKeys that can be represented by an address. However, raw scripts (such as OP_TRUE
) or P2PK can not be represented by an address, which complicates testing.
generatetoaddress
RPC can only generate to scriptPubKeys that can be represented by an address. However, raw scripts (such as OP_TRUE
) or P2PK can not be represented by an address, which complicates testing.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
162+ const int num_blocks{request.params[0].get_int()};
163+ const int64_t max_tries{request.params[2].isNull() ? 1000000 : request.params[2].get_int()};
164+
165+ FlatSigningProvider key_provider;
166+ std::string error;
167+ const auto desc = Parse(request.params[1].get_str(), key_provider, error, /* require_checksum = */ true);
1003@@ -961,6 +1004,7 @@ static const CRPCCommand commands[] =
1004
1005
1006 { "generating", "generatetoaddress", &generatetoaddress, {"nblocks","address","maxtries"} },
1007+ { "generating", "generatetodescriptor", &generatetodescriptor, {"num_blocks","descriptor","maxtries"} },
generatetoaddress
isn’t hidden, so I used the same. Otherwise it would also be missing from the gui-autocomplete.
CHECK_NONFATAL