Skip to content

Commit c7ee0ac

Browse files
committed
Merge #803: getwalletpakinfo: Use offline counter when reporting lookahead
76fbb4b getwalletpakinfo: Use offline counter when reporting lookahead (Gregory Sanders) Pull request description: resolves #802 Tree-SHA512: 37cac0979e0cd7a773d6298fcfb86f5e5719694fb20041eadd1556f70a8476fe3993a734fc286caf74ac02caed8ff8c6eb3e0978675d63509e861025599c35c8
2 parents 7754cd3 + 76fbb4b commit c7ee0ac

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/wallet/rpcdump.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1595,8 +1595,11 @@ UniValue getwalletpakinfo(const JSONRPCRequest& request)
15951595
ret.pushKV("liquid_pak", HexStr(pwallet->online_key));
15961596
ret.pushKV("liquid_pak_address", EncodeDestination(PKHash(pwallet->online_key)));
15971597

1598+
// We know that the number is non-negative from earlier check
1599+
unsigned int counter = (unsigned int)pwallet->offline_counter;
1600+
15981601
UniValue address_list(UniValue::VARR);
1599-
for (unsigned int i = 0; i < 3; i++) {
1602+
for (unsigned int i = counter; i < counter+3; i++) {
16001603
std::vector<CScript> scripts;
16011604
if (!desc->Expand(i, provider, scripts, provider)) {
16021605
throw JSONRPCError(RPC_WALLET_ERROR, "Could not generate lookahead addresses with descriptor. This is a bug.");

0 commit comments

Comments
 (0)