Add WALLET_FLAG_DESCRIPTORS

pull/16528/head
Andrew Chow 5 years ago
parent 6b8119af53
commit 96accc73f0

@ -2452,6 +2452,7 @@ static UniValue getwalletinfo(const JSONRPCRequest& request)
{RPCResult::Type::NUM, "duration", "elapsed seconds since scan start"}, {RPCResult::Type::NUM, "duration", "elapsed seconds since scan start"},
{RPCResult::Type::NUM, "progress", "scanning progress percentage [0.0, 1.0]"}, {RPCResult::Type::NUM, "progress", "scanning progress percentage [0.0, 1.0]"},
}}, }},
{RPCResult::Type::BOOL, "descriptors", "whether this wallet uses descriptors for scriptPubKey management"},
}}, }},
}, },
RPCExamples{ RPCExamples{
@ -2505,6 +2506,7 @@ static UniValue getwalletinfo(const JSONRPCRequest& request)
} else { } else {
obj.pushKV("scanning", false); obj.pushKV("scanning", false);
} }
obj.pushKV("descriptors", pwallet->IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS));
return obj; return obj;
} }

@ -111,7 +111,8 @@ static constexpr uint64_t KNOWN_WALLET_FLAGS =
WALLET_FLAG_AVOID_REUSE WALLET_FLAG_AVOID_REUSE
| WALLET_FLAG_BLANK_WALLET | WALLET_FLAG_BLANK_WALLET
| WALLET_FLAG_KEY_ORIGIN_METADATA | WALLET_FLAG_KEY_ORIGIN_METADATA
| WALLET_FLAG_DISABLE_PRIVATE_KEYS; | WALLET_FLAG_DISABLE_PRIVATE_KEYS
| WALLET_FLAG_DESCRIPTORS;
static constexpr uint64_t MUTABLE_WALLET_FLAGS = static constexpr uint64_t MUTABLE_WALLET_FLAGS =
WALLET_FLAG_AVOID_REUSE; WALLET_FLAG_AVOID_REUSE;
@ -121,6 +122,7 @@ static const std::map<std::string,WalletFlags> WALLET_FLAG_MAP{
{"blank", WALLET_FLAG_BLANK_WALLET}, {"blank", WALLET_FLAG_BLANK_WALLET},
{"key_origin_metadata", WALLET_FLAG_KEY_ORIGIN_METADATA}, {"key_origin_metadata", WALLET_FLAG_KEY_ORIGIN_METADATA},
{"disable_private_keys", WALLET_FLAG_DISABLE_PRIVATE_KEYS}, {"disable_private_keys", WALLET_FLAG_DISABLE_PRIVATE_KEYS},
{"descriptor_wallet", WALLET_FLAG_DESCRIPTORS},
}; };
extern const std::map<uint64_t,std::string> WALLET_FLAG_CAVEATS; extern const std::map<uint64_t,std::string> WALLET_FLAG_CAVEATS;

@ -55,6 +55,9 @@ enum WalletFlags : uint64_t {
//! bitcoin from opening the wallet, thinking it was newly created, and //! bitcoin from opening the wallet, thinking it was newly created, and
//! then improperly reinitializing it. //! then improperly reinitializing it.
WALLET_FLAG_BLANK_WALLET = (1ULL << 33), WALLET_FLAG_BLANK_WALLET = (1ULL << 33),
//! Indicate that this wallet supports DescriptorScriptPubKeyMan
WALLET_FLAG_DESCRIPTORS = (1ULL << 34),
}; };
//! Get the path of the wallet directory. //! Get the path of the wallet directory.

Loading…
Cancel
Save