mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
merge bitcoin#15751: Speed up deriveaddresses for large ranges
This commit is contained in:
parent
7ae2e66612
commit
9b52fb36da
@ -381,8 +381,8 @@ UniValue deriveaddresses(const JSONRPCRequest& request)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FlatSigningProvider provider;
|
FlatSigningProvider key_provider;
|
||||||
auto desc = Parse(desc_str, provider, /* require_checksum = */ true);
|
auto desc = Parse(desc_str, key_provider, /* require_checksum = */ true);
|
||||||
if (!desc) {
|
if (!desc) {
|
||||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("Invalid descriptor"));
|
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("Invalid descriptor"));
|
||||||
}
|
}
|
||||||
@ -398,8 +398,9 @@ UniValue deriveaddresses(const JSONRPCRequest& request)
|
|||||||
UniValue addresses(UniValue::VARR);
|
UniValue addresses(UniValue::VARR);
|
||||||
|
|
||||||
for (int i = range_begin; i <= range_end; ++i) {
|
for (int i = range_begin; i <= range_end; ++i) {
|
||||||
|
FlatSigningProvider provider;
|
||||||
std::vector<CScript> scripts;
|
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"));
|
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("Cannot derive script without private keys"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user