Skip to content

Commit

Permalink
Added missing blank value in some RPC commands
Browse files Browse the repository at this point in the history
  • Loading branch information
mxaddict committed Feb 16, 2024
1 parent 5069033 commit 56670dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/wallet/rpc/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ static RPCHelpMan getwalletinfo()
{RPCResult::Type::BOOL, "descriptors", "whether this wallet uses descriptors for scriptPubKey management"},
{RPCResult::Type::BOOL, "external_signer", "whether this wallet is configured to use an external signer such as a hardware wallet"},
{RPCResult::Type::BOOL, "blsct", "whether this wallet supports BLSCT keys"},
{RPCResult::Type::BOOL, "blank", "Whether this wallet intentionally does not contain any keys, scripts, or descriptors"},
{RPCResult::Type::NUM_TIME, "birthtime", /*optional=*/true, "The start time for blocks scanning. It could be modified by (re)importing any descriptor with an earlier timestamp."},
RESULT_LAST_PROCESSED_BLOCK,
}},
},
Expand Down Expand Up @@ -130,6 +132,10 @@ static RPCHelpMan getwalletinfo()
obj.pushKV("descriptors", pwallet->IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS));
obj.pushKV("external_signer", pwallet->IsWalletFlagSet(WALLET_FLAG_EXTERNAL_SIGNER));
obj.pushKV("blsct", pwallet->IsWalletFlagSet(WALLET_FLAG_BLSCT));
obj.pushKV("blank", pwallet->IsWalletFlagSet(WALLET_FLAG_BLANK_WALLET));
if (int64_t birthtime = pwallet->GetBirthTime(); birthtime != UNKNOWN_TIME) {
obj.pushKV("birthtime", birthtime);
}

AppendLastProcessedBlock(obj, *pwallet);
return obj;
Expand Down
1 change: 1 addition & 0 deletions test/functional/wallet_blank.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def test_importaddress(self):
self.nodes[0].createwallet(wallet_name="iaddr", disable_private_keys=True, blank=True)
wallet = self.nodes[0].get_wallet_rpc("iaddr")
info = wallet.getwalletinfo()
print(info)
assert_equal(info["descriptors"], False)
assert_equal(info["blank"], True)
wallet.importaddress(ADDRESS_BCRT1_UNSPENDABLE)
Expand Down

0 comments on commit 56670dc

Please sign in to comment.