Skip to content

Commit

Permalink
Merge #804: backport of 'getwalletpakinfo: Use offline counter when r…
Browse files Browse the repository at this point in the history
…eporting lookahead'

b5cefbe getwalletpakinfo: Use offline counter when reporting lookahead (Gregory Sanders)

Pull request description:

  backport of #802.

Tree-SHA512: 03c8d0a9905002e0b596a55ace165b908630b4279f0b6e2432d7451bb55b04da10574196c3b38a2e58b2da5ff89ef0b560a9799628c94a3fc6fd1d1abb2a5acc
  • Loading branch information
stevenroose committed Jan 16, 2020
2 parents f817684 + b5cefbe commit 7d2d10e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/wallet/rpcdump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1601,8 +1601,11 @@ UniValue getwalletpakinfo(const JSONRPCRequest& request)
ret.pushKV("liquid_pak", HexStr(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);
for (unsigned int i = 0; i < 3; i++) {
for (unsigned int i = counter; i < counter+3; i++) {
std::vector<CScript> scripts;
if (!desc->Expand(i, provider, scripts, provider)) {
throw JSONRPCError(RPC_WALLET_ERROR, "Could not generate lookahead addresses with descriptor. This is a bug.");
Expand Down

0 comments on commit 7d2d10e

Please sign in to comment.