diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2019-04-04 13:12:21 -0700 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2019-04-04 13:12:21 -0700 |
commit | 41a46cbb31f1622f7d1ff54c7a1c1ca701c1e754 (patch) | |
tree | 70d5898e5f3d12594a0a2b23624d7bffd24fa6d5 /src/rpc | |
parent | daef20fb50c00240ea4a5d653f3a47ee604d25c1 (diff) |
Speed up deriveaddresses for large ranges
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/misc.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index 0a97f80297..d9d1d5fa1d 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -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")); } |