Skip to content

Commit

Permalink
rpc: Add unlocked_staking_only info in getwalletinfo RPC
Browse files Browse the repository at this point in the history
  • Loading branch information
lateminer committed Jan 31, 2024
1 parent 32fdb90 commit bc34536
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/wallet/rpc/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ static RPCHelpMan getwalletinfo()
{RPCResult::Type::STR_AMOUNT, "paytxfee", "the transaction fee configuration, set in " + CURRENCY_UNIT + "/kvB"},
{RPCResult::Type::STR_HEX, "hdseedid", /*optional=*/true, "the Hash160 of the HD seed (only present when HD is enabled)"},
{RPCResult::Type::BOOL, "private_keys_enabled", "false if privatekeys are disabled for this wallet (enforced watch-only wallet)"},
{RPCResult::Type::BOOL, "unlocked_staking_only", /*optional=*/true, "true if wallet is unlocked for staking only"},
{RPCResult::Type::BOOL, "avoid_reuse", "whether this wallet tracks clean/dirty coins in terms of reuse"},
{RPCResult::Type::OBJ, "scanning", "current scanning details, or false if no scan is in progress",
{
Expand Down Expand Up @@ -117,6 +118,8 @@ static RPCHelpMan getwalletinfo()
}
if (pwallet->IsCrypted()) {
obj.pushKV("unlocked_until", pwallet->nRelockTime);
bool stakingOnly = pwallet->m_wallet_unlock_staking_only;
obj.pushKV("unlocked_staking_only", stakingOnly);
}
obj.pushKV("paytxfee", ValueFromAmount(pwallet->m_pay_tx_fee.GetFeePerK()));
obj.pushKV("private_keys_enabled", !pwallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS));
Expand Down

0 comments on commit bc34536

Please sign in to comment.