Skip to content

Commit

Permalink
Merge #6108: fix: remove keypool replenishment stat and warning for d…
Browse files Browse the repository at this point in the history
…escriptor wallet

b7c7bff rpc: remove keypool replenishment stat and warning for descriptor wallet (Kittywhiskers Van Gogh)

Pull request description:

  ## Breaking Changes

  - `getcoinjoininfo` will no longer report `keys_left` and will not incorrectly warn about keypool depletion with descriptor wallets

  ## Checklist:
    _Go over all the following points, and put an `x` in all the boxes that apply._
  - [x] I have performed a self-review of my own code
  - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)**
  - [x] I have added or updated relevant unit/integration/functional/e2e tests **(note: N/A)**
  - [x] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  UdjinM6:
    utACK b7c7bff
  knst:
    utACK b7c7bff
  UdjinM6:
    re-utACK b7c7bff
  PastaPastaPasta:
    utACK b7c7bff

Tree-SHA512: d6e55698a30288308e206566bafb7ea4cd465f37c3f6975410ff15b246500e576ee006da712d28eaa1d4845451f19b218e8c4d11f311b860ed674ad52dca1e0c
  • Loading branch information
PastaPastaPasta committed Jul 16, 2024
2 parents f16025f + b7c7bff commit 09239a1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 4 additions & 0 deletions doc/release-notes-6108.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
RPC changes
-----------

- `getcoinjoininfo` will no longer report `keys_left` and will not incorrectly warn about keypool depletion with descriptor wallets
13 changes: 9 additions & 4 deletions src/rpc/coinjoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ static RPCHelpMan getcoinjoininfo()
{RPCResult::Type::NUM, "entries_count", "The number of entries in the mixing session"},
}},
}},
{RPCResult::Type::NUM, "keys_left", "How many new keys are left since last automatic backup"},
{RPCResult::Type::NUM, "keys_left", /* optional */ true, "How many new keys are left since last automatic backup (if applicable)"},
{RPCResult::Type::STR, "warnings", "Warnings if any"},
}},
RPCResult{"for masternodes",
Expand Down Expand Up @@ -267,9 +267,14 @@ static RPCHelpMan getcoinjoininfo()
CHECK_NONFATAL(manager != nullptr);
manager->GetJsonInfo(obj);

obj.pushKV("keys_left", wallet->nKeysLeftSinceAutoBackup);
obj.pushKV("warnings", wallet->nKeysLeftSinceAutoBackup < COINJOIN_KEYS_THRESHOLD_WARNING
? "WARNING: keypool is almost depleted!" : "");
std::string warning_msg{""};
if (wallet->IsLegacy()) {
obj.pushKV("keys_left", wallet->nKeysLeftSinceAutoBackup);
if (wallet->nKeysLeftSinceAutoBackup < COINJOIN_KEYS_THRESHOLD_WARNING) {
warning_msg = "WARNING: keypool is almost depleted!";
}
}
obj.pushKV("warnings", warning_msg);
#endif // ENABLE_WALLET

return obj;
Expand Down

0 comments on commit 09239a1

Please sign in to comment.