From 56670dc596d692113f3a4b8cd6470cc013ef6d85 Mon Sep 17 00:00:00 2001 From: mxaddict Date: Sat, 17 Feb 2024 05:39:33 +0800 Subject: [PATCH] Added missing blank value in some RPC commands --- src/wallet/rpc/wallet.cpp | 6 ++++++ test/functional/wallet_blank.py | 1 + 2 files changed, 7 insertions(+) diff --git a/src/wallet/rpc/wallet.cpp b/src/wallet/rpc/wallet.cpp index d665f8f6a7a43..fdd5343c5b7ae 100644 --- a/src/wallet/rpc/wallet.cpp +++ b/src/wallet/rpc/wallet.cpp @@ -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, }}, }, @@ -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; diff --git a/test/functional/wallet_blank.py b/test/functional/wallet_blank.py index e646d270059df..91a74e4926bf5 100755 --- a/test/functional/wallet_blank.py +++ b/test/functional/wallet_blank.py @@ -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)