mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
getwalletpakinfo: Use offline counter when reporting lookahead
This commit is contained in:
parent
169940c7a7
commit
b5cefbe1ae
1 changed files with 4 additions and 1 deletions
|
|
@ -1601,8 +1601,11 @@ UniValue getwalletpakinfo(const JSONRPCRequest& request)
|
||||||
ret.pushKV("liquid_pak", HexStr(pwallet->online_key));
|
ret.pushKV("liquid_pak", HexStr(pwallet->online_key));
|
||||||
ret.pushKV("liquid_pak_address", EncodeDestination(PKHash(pwallet->online_key)));
|
ret.pushKV("liquid_pak_address", EncodeDestination(PKHash(pwallet->online_key)));
|
||||||
|
|
||||||
|
// We know that the number is non-negative from earlier check
|
||||||
|
unsigned int counter = (unsigned int)pwallet->offline_counter;
|
||||||
|
|
||||||
UniValue address_list(UniValue::VARR);
|
UniValue address_list(UniValue::VARR);
|
||||||
for (unsigned int i = 0; i < 3; i++) {
|
for (unsigned int i = counter; i < counter+3; i++) {
|
||||||
std::vector<CScript> scripts;
|
std::vector<CScript> scripts;
|
||||||
if (!desc->Expand(i, provider, scripts, provider)) {
|
if (!desc->Expand(i, provider, scripts, provider)) {
|
||||||
throw JSONRPCError(RPC_WALLET_ERROR, "Could not generate lookahead addresses with descriptor. This is a bug.");
|
throw JSONRPCError(RPC_WALLET_ERROR, "Could not generate lookahead addresses with descriptor. This is a bug.");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue