Speed up deriveaddresses for large ranges
This commit is contained in:
parent
daef20fb50
commit
41a46cbb31
1 changed files with 4 additions and 3 deletions
|
@ -228,8 +228,8 @@ UniValue deriveaddresses(const JSONRPCRequest& request)
|
|||
range_end = range.second;
|
||||
}
|
||||
|
||||
FlatSigningProvider provider;
|
||||
auto desc = Parse(desc_str, provider, /* require_checksum = */ true);
|
||||
FlatSigningProvider key_provider;
|
||||
auto desc = Parse(desc_str, key_provider, /* require_checksum = */ true);
|
||||
if (!desc) {
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("Invalid descriptor"));
|
||||
}
|
||||
|
@ -245,8 +245,9 @@ UniValue deriveaddresses(const JSONRPCRequest& request)
|
|||
UniValue addresses(UniValue::VARR);
|
||||
|
||||
for (int i = range_begin; i <= range_end; ++i) {
|
||||
FlatSigningProvider provider;
|
||||
std::vector<CScript> scripts;
|
||||
if (!desc->Expand(i, provider, scripts, provider)) {
|
||||
if (!desc->Expand(i, key_provider, scripts, provider)) {
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("Cannot derive script without private keys"));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue